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