Patch by Andrew Wason, rectalogic rectalogic com Originally committed as revision 25023 to svn://svn.ffmpeg.org/ffmpeg/trunk