Compatibility patches for new ffmpeg API