patch by Alexander Strange, astrange at ithinksw dot com Originally committed as revision 6410 to svn://svn.ffmpeg.org/ffmpeg/trunk