summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorMarcoen Hirschberg <m.hirschberg@activevideo.com>2014-05-27 16:45:19 +0200
committerwm4 <wm4@nowhere>2014-05-28 21:38:20 +0200
commitecea66e8dcba7a1b6fc21fc90afe2630b1b04f39 (patch)
tree24390914f6313f5a2481f35fb483d35b7de94b30 /video/decode
parent1fa48a2452d67f71a600e601d2a14bb8ad9c78e1 (diff)
downloadmpv-ecea66e8dcba7a1b6fc21fc90afe2630b1b04f39.tar.bz2
mpv-ecea66e8dcba7a1b6fc21fc90afe2630b1b04f39.tar.xz
vd_lavc: set video bitrate if available
Set the bitrate of dec_video if it is available in avcodec.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vd_lavc.c5
1 files changed, 5 insertions, 0 deletions
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;