original patch by Peter Ross Originally committed as revision 10880 to svn://svn.ffmpeg.org/ffmpeg/trunk