From: John Stebbins Date: Fri, 28 Dec 2018 17:24:54 +0000 (-0700) Subject: avfilter: fix yadif options X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2965a5c02901e8ac1e4c5f6e637996c8576b2e7f;p=handbrake 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 --- 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);