Patch by Daniel Verkamp daniel @ drv @ nu. Originally committed as revision 18768 to svn://svn.ffmpeg.org/ffmpeg/trunk