summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-26 05:53:44 +0100
committerKevin Mitchell <kevmitch@gmail.com>2017-12-28 00:59:22 -0700
commitd480b1261b92fcf2ba08bd0934a86e65220d8950 (patch)
tree464727c200327988e615e13478f5b7c1f4c0b4b8 /video/decode
parentf6a582e0b29daa9053ba782fd0d6bc787d01e5db (diff)
downloadmpv-d480b1261b92fcf2ba08bd0934a86e65220d8950.tar.bz2
mpv-d480b1261b92fcf2ba08bd0934a86e65220d8950.tar.xz
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.
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 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