patch by Jan Knutar <jknutar -- at -- nic -- dot -- fi> Originally committed as revision 4619 to svn://svn.ffmpeg.org/ffmpeg/trunk