based on a patch by Denes Balatoni, dbalatoni interware hu Originally committed as revision 10486 to svn://svn.ffmpeg.org/ffmpeg/trunk