Patch by Jai Menon (realityman <at> gmx.net) Originally committed as revision 12633 to svn://svn.ffmpeg.org/ffmpeg/trunk