diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-10-03 15:19:10 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-12-06 10:25:08 +0100 |
commit | 3f5c99fcbb2c366d7bdef8500c19f43a33bdb6b9 (patch) | |
tree | 3ba584acf53d6d84df2af1e9bc07396adc5a9ad3 /libavcodec/mpegvideo_enc.c | |
parent | 732a37d1466d45b3812509d68c82e783530e291a (diff) |
mpegvideo_enc: export CPB props side data
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index b76d0ad25a..9336051430 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -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); |