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