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