Patch by Thierry Foucu, tfoucu at gmail Originally committed as revision 24379 to svn://svn.ffmpeg.org/ffmpeg/trunk