]> granicus.if.org Git - handbrake/commitdiff
avfilter: fix yadif options
authorJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 28 Dec 2018 17:24:54 +0000 (10:24 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 28 Dec 2018 17:24:54 +0000 (10:24 -0700)
'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

index 91b5713017ef8bcb4b7d2304279f8290283733c4..c5d65f69e7e16dc53f8bcc979359ed03438531da 100644 (file)
@@ -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);