patch by Dylan Yudaken, dyudaken gmail com Originally committed as revision 18274 to svn://svn.ffmpeg.org/ffmpeg/trunk