Patch by Alexei Svitkine, alexei dot svitkine at gmail Originally committed as revision 23749 to svn://svn.ffmpeg.org/ffmpeg/trunk