Patch by Gwenolé Beauchesne. Originally committed as revision 17646 to svn://svn.ffmpeg.org/ffmpeg/trunk