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