Patch by Matthieu Castet <castet matthieu free fr> Originally committed as revision 14032 to svn://svn.ffmpeg.org/ffmpeg/trunk