patch by Nicholas Tung, ntung ntung com Originally committed as revision 8649 to svn://svn.ffmpeg.org/ffmpeg/trunk