patch by Anton Khirnov wyskas _at_ gmail _dot_ com Originally committed as revision 20277 to svn://svn.ffmpeg.org/ffmpeg/trunk