From ecea66e8dcba7a1b6fc21fc90afe2630b1b04f39 Mon Sep 17 00:00:00 2001 From: Marcoen Hirschberg Date: Tue, 27 May 2014 16:45:19 +0200 Subject: vd_lavc: set video bitrate if available Set the bitrate of dec_video if it is available in avcodec. --- video/decode/vd_lavc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 9ef49c25e1..1d04b5cd3d 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -281,6 +281,10 @@ static int init(struct dec_video *vd, const char *decoder) return 0; } } + + if (ctx->avctx->bit_rate != 0) + vd->bitrate = ctx->avctx->bit_rate; + return 1; } @@ -321,6 +325,7 @@ static void init_avctx(struct dec_video *vd, const char *decoder, ctx->hwdec_fmt = 0; ctx->avctx = avcodec_alloc_context3(lavc_codec); AVCodecContext *avctx = ctx->avctx; + avctx->bit_rate = 0; avctx->opaque = vd; avctx->codec_type = AVMEDIA_TYPE_VIDEO; avctx->codec_id = lavc_codec->id; -- cgit v1.2.3