Patch by Michael Tison (gmail address: blackspike@....) Originally committed as revision 20890 to svn://svn.ffmpeg.org/ffmpeg/trunk