patch from elupusateccedotse Originally committed as revision 11072 to svn://svn.ffmpeg.org/ffmpeg/trunk