]> granicus.if.org Git - handbrake/commitdiff
preset: fix behavior of AudioSecondaryEncoderMode
authorJohn Stebbins <jstebbins.hb@gmail.com>
Sun, 29 Jan 2017 17:21:02 +0000 (10:21 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Sun, 29 Jan 2017 17:23:07 +0000 (10:23 -0700)
When true, this is meant to use the secondary encoder only for the first
selected audio track.  It was completely broken :(

(cherry picked from commit d03ffb0aa349145ebea8bf314f94f55f3f1ba370)

libhb/preset.c

index e07620f19d7cc6313bb4a349346e9ce85f666b6c..cef89d0a2f47c715d1f3d85cbce1563b898f8660 100644 (file)
@@ -615,13 +615,13 @@ static void add_audio_for_lang(hb_value_array_t *list, const hb_dict_t *preset,
     hb_value_array_t * encoder_list = hb_dict_get(preset, "AudioList");
     int count = hb_value_array_len(encoder_list);
     int track = find_audio_track(title, lang, 0, behavior);
-    int current_mode = 0;
     while (track >= 0)
     {
+        int track_count = hb_value_array_len(list);
         char key[8];
         snprintf(key, sizeof(key), "%d", track);
 
-        count = current_mode ? 1 : count;
+        count = mode && track_count ? 1 : count;
         int ii;
         for (ii = 0; ii < count; ii++)
         {