build: fix tsmf ffmpeg build

Backported fixes to build against libavcodec >= 9.0
Merge pull request #2031 from bmiklautz/fix/stable-1.1/ffmpeg2

build: fix tsmf ffmpeg build