patch by Vitor: {vitor1001 gmail com} Originally committed as revision 9419 to svn://svn.ffmpeg.org/ffmpeg/trunk