From d480b1261b92fcf2ba08bd0934a86e65220d8950 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 26 Dec 2017 05:53:44 +0100 Subject: vd_lavc: add an option to explicitly workaround x264 4:4:4 bug Technically, the user could just use --vd-lavc-o with the same result. But I find it better to make this an explicit option, so we can document the ups and downs, and also avoid setting it for non-h264. --- video/decode/vd_lavc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video/decode') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 29bf3ec56f..0f31de9f02 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -80,6 +80,7 @@ struct vd_lavc_params { int framedrop; int threads; int bitexact; + int old_x264; int check_hw_profile; int software_fallback; char **avopts; @@ -109,6 +110,7 @@ const struct m_sub_options vd_lavc_conf = { OPT_DISCARD("framedrop", framedrop, 0), OPT_INT("threads", threads, M_OPT_MIN, .min = 0), OPT_FLAG("bitexact", bitexact, 0), + OPT_FLAG("assume-old-x264", old_x264, 0), OPT_FLAG("check-hw-profile", check_hw_profile, 0), OPT_CHOICE_OR_INT("software-fallback", software_fallback, 0, 1, INT_MAX, ({"no", INT_MAX}, {"yes", 1})), @@ -647,6 +649,9 @@ static void init_avctx(struct dec_video *vd) avctx->skip_idct = lavc_param->skip_idct; avctx->skip_frame = lavc_param->skip_frame; + if (lavc_codec->id == AV_CODEC_ID_H264 && lavc_param->old_x264) + av_opt_set(avctx, "x264_build", "150", AV_OPT_SEARCH_CHILDREN); + mp_set_avopts(vd->log, avctx, lavc_param->avopts); // Do this after the above avopt handling in case it changes values -- cgit v1.2.3