mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-24 08:12:44 +00:00
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>
This commit is contained in:
parent
944212acad
commit
46c6ca3ed1
@ -178,6 +178,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
|||||||
AACContext *s = avctx->priv_data;
|
AACContext *s = avctx->priv_data;
|
||||||
int ret = AVERROR(EINVAL);
|
int ret = AVERROR(EINVAL);
|
||||||
AACENC_InfoStruct info = { 0 };
|
AACENC_InfoStruct info = { 0 };
|
||||||
|
AVCPBProperties *cpb_props;
|
||||||
CHANNEL_MODE mode;
|
CHANNEL_MODE mode;
|
||||||
AACENC_ERROR err;
|
AACENC_ERROR err;
|
||||||
int aot = AV_PROFILE_AAC_LOW + 1;
|
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);
|
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;
|
return 0;
|
||||||
error:
|
error:
|
||||||
aac_encode_close(avctx);
|
aac_encode_close(avctx);
|
||||||
|
Loading…
Reference in New Issue
Block a user