Apply upstream fixes to build correctly against newer ffmpeg.