Patch by Tom Harper <d.thomas.harper <at> gmail.com> Originally committed as revision 11200 to svn://svn.ffmpeg.org/ffmpeg/trunk