build: fix tsmf ffmpeg 

Backport commits from master for building against libavcodec
>= 55.