mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-07 00:20:09 +02:00
mpegvideo_enc: export CPB props side data
This commit is contained in:
parent
732a37d146
commit
3f5c99fcbb
@ -241,6 +241,7 @@ static void mpv_encode_defaults(MpegEncContext *s)
|
||||
av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
|
||||
{
|
||||
MpegEncContext *s = avctx->priv_data;
|
||||
AVCPBProperties *cpb_props;
|
||||
int i, ret, format_supported;
|
||||
|
||||
mpv_encode_defaults(s);
|
||||
@ -882,6 +883,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
}
|
||||
|
||||
cpb_props = ff_add_cpb_side_data(avctx);
|
||||
if (!cpb_props)
|
||||
return AVERROR(ENOMEM);
|
||||
cpb_props->max_bitrate = avctx->rc_max_rate;
|
||||
cpb_props->min_bitrate = avctx->rc_min_rate;
|
||||
cpb_props->avg_bitrate = avctx->bit_rate;
|
||||
cpb_props->buffer_size = avctx->rc_buffer_size;
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
ff_mpv_encode_end(avctx);
|
||||
|
Loading…
Reference in New Issue
Block a user