build: fix tsmf ffmpeg build

Backported more fixes to build against libavcodec >= 9.0