patch by Kenan Gillet, kenan.gillet gmail com Originally committed as revision 15680 to svn://svn.ffmpeg.org/ffmpeg/trunk