Debugged by Howard Chu, hyc at highlandsun dot com. backport r23151 by mstorsjo Originally committed as revision 23224 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6