Patch by Alexander Kojevnikov, alexander kojevnikov com Originally committed as revision 24539 to svn://svn.ffmpeg.org/ffmpeg/trunk