Originally committed as revision 25021 to svn://svn.ffmpeg.org/ffmpeg/trunk
Patch by James Darnley <james darnley at gmail>. Originally committed as revision 22605 to svn://svn.ffmpeg.org/ffmpeg/trunk