Patch by avcoder, ffmpeg gmail Originally committed as revision 25859 to svn://svn.ffmpeg.org/ffmpeg/trunk