Patch by Daniel Verkamp $firstname@drv DOT nu. Originally committed as revision 18998 to svn://svn.ffmpeg.org/ffmpeg/trunk