ffmpeg: Cleanup and bug fixes.