Patch by zhentan feng. Originally committed as revision 14826 to svn://svn.ffmpeg.org/ffmpeg/trunk
Originally committed as revision 14655 to svn://svn.ffmpeg.org/ffmpeg/trunk