]> granicus.if.org Git - handbrake/commitdiff
CLI: don't override preset subtitle burn defaults...
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 22 Mar 2017 18:24:03 +0000 (11:24 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 22 Mar 2017 18:25:36 +0000 (11:25 -0700)
Unless user explicitly overrides with command line options

(cherry picked from commit 21aceef60d6dcdd5f523fbae21357c666b9d7f6d)

test/test.c

index 2e9c115f977944a2ad228de5d4ff036b845769a2..92d93b9d32ac5005d0be98bd041a3fdcdda3d7b5 100644 (file)
@@ -113,8 +113,8 @@ static char ** subtitle_lang_list        = NULL;
 static char ** subtracks                 = NULL;
 static char ** subforce                  = NULL;
 static int     subtitle_all              = -1;
-static int     subburn                   = 0;
-static int     subburn_native            = 0;
+static int     subburn                   = -1;
+static int     subburn_native            = -1;
 static int     subdefault                = 0;
 static char ** srtfile                   = NULL;
 static char ** srtcodeset                = NULL;
@@ -3172,31 +3172,34 @@ static hb_dict_t * PreparePreset(const char *preset_name)
         // Add foreign audio search
         hb_dict_set(preset, "SubtitleAddForeignAudioSearch", hb_value_bool(1));
     }
-    // Subtitle burn behavior
-    const char *burn = "none";
-    if (subtitle_track_count == 0)
+    if (subburn_native >= 0 || subburn >= 0)
     {
-        if (subburn_native && subburn == 1)
+        // Subtitle burn behavior
+        const char *burn = "none";
+        if (subtitle_track_count == 0)
         {
-            burn = "foreign_first";
-        }
-        else if (subburn_native)
-        {
-            burn = "foreign";
-        }
-        else if (subburn == 1)
-        {
-            burn = "first";
+            if (subburn_native == 1 && subburn == 1)
+            {
+                burn = "foreign_first";
+            }
+            else if (subburn_native == 1)
+            {
+                burn = "foreign";
+            }
+            else if (subburn == 1)
+            {
+                burn = "first";
+            }
         }
-    }
-    else
-    {
-        if (subburn_native)
+        else
         {
-            burn = "foreign";
+            if (subburn_native == 1)
+            {
+                burn = "foreign";
+            }
         }
+        hb_dict_set(preset, "SubtitleBurnBehavior", hb_value_string(burn));
     }
-    hb_dict_set(preset, "SubtitleBurnBehavior", hb_value_string(burn));
     const char *selection = NULL;
     if (subtitle_track_count == 0 && subtitle_all != -1)
     {