Improved for ffmpeg 0.8.5