Patch by Daniel Verkamp daniel AT drv + nu. Originally committed as revision 18767 to svn://svn.ffmpeg.org/ffmpeg/trunk