based on a patch by Ismail Dönmez ismail$$at$$pardus$$dot$$org$$dot$$tr Originally committed as revision 5502 to svn://svn.ffmpeg.org/ffmpeg/trunk