patch by Ronald S. Bultje, rsbultje gmail com Originally committed as revision 9818 to svn://svn.ffmpeg.org/ffmpeg/trunk