Based on a patch by "S.N. Hemanth Meenakshisundaram" smeenaks!ucsd!edu. Originally committed as revision 25188 to svn://svn.ffmpeg.org/ffmpeg/trunk