Patch by Josh Allmann, josh dot allmann at gmail Originally committed as revision 23531 to svn://svn.ffmpeg.org/ffmpeg/trunk