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