libfdk-aacdec: Always decode into an intermediate buffer

Multimedia / Libav - Martin Storsjö [martin.st] - 15 August 2015 16:17 UTC

For ADTS streams, the output format (number of channels, frame size) can change at any point (with the latest version of fdk-aac, the decoder seems to change format after a handful of frames, not outputting the right format immediately, for cases that worked fine with the earlier
version of the lib).

Previously, the decoder decoded straight into the output frame once the number of channels and frame size was known. This obviously does not work if the number of channels or frame size changes.

The alternative would be to allocate the AVFrame with the maximum number of channels and frame size, and change them afterward decoding into it, but that may cause confusion to users e.g. of the get_buffer callback. This solution should be more robust.

CC: libav-stable@libav.org

1b90433 libfdk-aacdec: Always decode into an intermediate buffer
libavcodec/libfdk-aacdec.c | 68 ++++++++++++--------------------------------
1 file changed, 18 insertions(+), 50 deletions(-)

Upstream: git.libav.org


  • Share