Patch by Laurent Aimar <fenrir at videolan dot org>. Originally committed as revision 21110 to svn://svn.ffmpeg.org/ffmpeg/trunk
Originally committed as revision 20957 to svn://svn.ffmpeg.org/ffmpeg/trunk