Originally committed as revision 23879 to svn://svn.ffmpeg.org/ffmpeg/trunk
Patch by Lou Logan. Originally committed as revision 22714 to svn://svn.ffmpeg.org/ffmpeg/trunk