patch by Ian Caulfield: /ian caulfield gmail com/ Originally committed as revision 9716 to svn://svn.ffmpeg.org/ffmpeg/trunk