patch by Panagiotis Issaris, takis%%.%%issaris%%@%%uhasselt%%.%%be Originally committed as revision 5966 to svn://svn.ffmpeg.org/ffmpeg/trunk