patch by Anton Khirnov anton _at_ khirnov _dot_ net Originally committed as revision 25357 to svn://svn.ffmpeg.org/ffmpeg/trunk