]> granicus.if.org Git - handbrake/commitdiff
CLI: interpret --all-audio as implicit list of all tracks
authorJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 13 Feb 2019 17:00:12 +0000 (10:00 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Wed, 13 Feb 2019 19:05:06 +0000 (12:05 -0700)
--all-audio was setting up the preset to apply each audio encoder in the
preset to each source track. And it was adding new entries in the presets
audio encoder list for any audio command line overrides.  This results in very
unintuitive behavior.

(cherry picked from commit e1e0e211759ce1413252b168d2d01479fed9f579)

test/test.c

index cf01f4a2a43103acaaa1d180e12664099bec73eb..4b3063c462d665fe64080258c0a074c632c19448 100644 (file)
@@ -3536,7 +3536,7 @@ static hb_dict_t * PreparePreset(const char *preset_name)
     }
 
     // Audio overrides
-    if (atracks == NULL && (
+    if (atracks == NULL && audio_all != 1 && (
         acodecs                   != NULL ||
         abitrates                 != NULL ||
         arates                    != NULL ||
@@ -3551,6 +3551,8 @@ static hb_dict_t * PreparePreset(const char *preset_name)
     {
         // No explicit audio tracks, but track settings modified.
         // Modify the presets audio settings.
+        //
+        // Note that --all-audio is explicitely asking for all tracks
         hb_value_array_t *list;
         list = hb_dict_get(preset, "AudioList");
         if (list == NULL)
@@ -4453,11 +4455,12 @@ PrepareJob(hb_handle_t *h, hb_title_t *title, hb_dict_t *preset_dict)
     hb_dict_t *audio_dict;
 
     /* Grab audio tracks */
-    if (atracks != NULL)
+    if (atracks != NULL || audio_all == 1)
     {
         int track_count;
         int ii;
-        if (atracks[0] != NULL && strcasecmp("none", atracks[0]))
+        if (atracks != NULL && atracks[0] != NULL &&
+            strcasecmp("none", atracks[0]))
         {
             // First "track" is not "none", add tracks
             for (ii = 0; atracks[ii] != NULL; ii++)