patch by Zuxy Meng, zuxy.meng gmail com Originally committed as revision 9030 to svn://svn.ffmpeg.org/ffmpeg/trunk