Skip to content

Draft: avauddec: fix decoding error thrown at end of wma files with FFmpeg 5.x

Starting with FFmpeg 5.x the WMA decoder clips lead-in samples and outputs some extra samples at the end. The decoder base class then throws an error in the drain function because we don't have any input frames left to finish at that point.

We fix this by not finishing/removing the initial input frame for the first decoded output in case lead-in samples were clipped. In order to know when lead-in samples get clipped we tell FFmpeg to let us do the clipping ourselves with AV_CODEC_FLAG2_SKIP_MANUAL.

Fixes #1348 (closed)

Merge request reports