Fix ffmpeg wrapper compatibility with libavcodec > 53.25.0

Based on pull request #685