Signed-off-by: Mans Rullgard <mans@mansr.com>
Originally committed as revision 22404 to svn://svn.ffmpeg.org/ffmpeg/trunk
Patch by Kostya, minor fixes by me. Originally committed as revision 21958 to svn://svn.ffmpeg.org/ffmpeg/trunk