From: John Stebbins Date: Wed, 22 Mar 2017 18:24:03 +0000 (-0700) Subject: CLI: don't override preset subtitle burn defaults... X-Git-Tag: 1.0.4~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e577726ad739f3b3be76fc3448d364c01c4b28a;p=handbrake CLI: don't override preset subtitle burn defaults... Unless user explicitly overrides with command line options (cherry picked from commit 21aceef60d6dcdd5f523fbae21357c666b9d7f6d) --- diff --git a/test/test.c b/test/test.c index 2e9c115f9..92d93b9d3 100644 --- a/test/test.c +++ b/test/test.c @@ -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) {