From 2965a5c02901e8ac1e4c5f6e637996c8576b2e7f Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Fri, 28 Dec 2018 10:24:54 -0700 Subject: [PATCH] avfilter: fix yadif options 'mode' still worked, but I've changed to use mnemonic string values. 'parity' still worked, but I've changed to use mnemonic string values. 'auto' failed, was replaced by 'deint=deinterlaced'. Fixes https://forum.handbrake.fr/viewtopic.php?f=6&t=38564 --- libhb/avfilter.c | 42 +++++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/libhb/avfilter.c b/libhb/avfilter.c index 91b571301..c5d65f69e 100644 --- a/libhb/avfilter.c +++ b/libhb/avfilter.c @@ -499,22 +499,46 @@ convert_deint_settings(const hb_dict_t * settings) { return hb_value_null(); } - int automatic = !!(mode & MODE_DECOMB_SELECTIVE); - int bob = !!(mode & MODE_YADIF_BOB); - int no_spatial = !(mode & MODE_YADIF_SPATIAL); - mode = bob | (no_spatial << 1); hb_dict_t * result = hb_dict_init(); hb_dict_t * avsettings = hb_dict_init(); - hb_dict_set(avsettings, "mode", hb_value_int(mode)); - if (automatic) + if (mode & MODE_YADIF_BOB) { - hb_dict_set(avsettings, "auto", hb_value_int(automatic)); + if (mode & MODE_YADIF_SPATIAL) + { + hb_dict_set(avsettings, "mode", hb_value_string("send_field")); + } + else + { + hb_dict_set(avsettings, "mode", + hb_value_string("send_field_nospatial")); + } + } + else + { + if (mode & MODE_YADIF_SPATIAL) + { + hb_dict_set(avsettings, "mode", hb_value_string("send_frame")); + } + else + { + hb_dict_set(avsettings, "mode", + hb_value_string("send_frame_nospatial")); + } + } + + if (mode & MODE_DECOMB_SELECTIVE) + { + hb_dict_set(avsettings, "deint", hb_value_string("interlaced")); + } + if (parity == 0) + { + hb_dict_set(avsettings, "parity", hb_value_string("tff")); } - if (parity != -1) + else if (parity == 1) { - hb_dict_set(avsettings, "parity", hb_value_int(parity)); + hb_dict_set(avsettings, "parity", hb_value_string("bff")); } hb_dict_set(result, "yadif", avsettings); -- 2.40.0