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