Patch from Anton Khirnov wyskas gmail Originally committed as revision 22017 to svn://svn.ffmpeg.org/ffmpeg/trunk