]> git.sesse.net Git - ffmpeg/commit
libfdk-aacdec: Always decode into an intermediate buffer
authorMartin Storsjö <martin@martin.st>
Fri, 14 Aug 2015 08:05:30 +0000 (11:05 +0300)
committerMartin Storsjö <martin@martin.st>
Sat, 15 Aug 2015 21:17:49 +0000 (00:17 +0300)
commit1b90433f79de857550d4d8c35c89fbe954920594
tree07e2b643a62f0c905acb673d1c4a6abd99028b86
parent87de6ddb7b7674e329d5c96677bd8685bc7f7855
libfdk-aacdec: Always decode into an intermediate buffer

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
Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/libfdk-aacdec.c