aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libfdk-aacenc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-11-17 23:01:38 -0300
committerJames Almer <jamrial@gmail.com>2024-11-22 10:57:03 -0300
commit46c6ca3ed1651c67faf899776f1922c108093a44 (patch)
treedf834e842e78f16e961428b253602ac10acefcec /libavcodec/libfdk-aacenc.c
parent944212acad7c2254d9dc14764b29e0023aaa645a (diff)
downloadffmpeg-46c6ca3ed1651c67faf899776f1922c108093a44.tar.gz
avcodec/libfdk-aacenc: export CPB properties
Needed to signal the muxer that the stream is VBR. Finishes fixing ticket #11303. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/libfdk-aacenc.c')
-rw-r--r--libavcodec/libfdk-aacenc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index 0f33cdb8c9..cc0ae0d8da 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -178,6 +178,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
AACContext *s = avctx->priv_data;
int ret = AVERROR(EINVAL);
AACENC_InfoStruct info = { 0 };
+ AVCPBProperties *cpb_props;
CHANNEL_MODE mode;
AACENC_ERROR err;
int aot = AV_PROFILE_AAC_LOW + 1;
@@ -438,6 +439,14 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
memcpy(avctx->extradata, info.confBuf, info.confSize);
}
+
+ cpb_props = ff_encode_add_cpb_side_data(avctx);
+ if (!cpb_props)
+ return AVERROR(ENOMEM);
+ cpb_props->max_bitrate =
+ cpb_props->min_bitrate =
+ cpb_props->avg_bitrate = avctx->bit_rate;
+
return 0;
error:
aac_encode_close(avctx);