patch by Henrik Gulbrandsen henrik at gulbra dot net Originally committed as revision 13003 to svn://svn.ffmpeg.org/ffmpeg/trunk