Patch by Gregory Montoir <cyx <at> users <dot> sourceforge <dot> net> Originally committed as revision 14146 to svn://svn.ffmpeg.org/ffmpeg/trunk