]> granicus.if.org Git - handbrake/commitdiff
presets: fix selection of audio tracks
authorJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 10 Nov 2017 18:18:09 +0000 (10:18 -0800)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 10 Nov 2017 18:18:09 +0000 (10:18 -0800)
The new audio attributes were not checked correctly and filtered out any
audio tracks that had the DEFAULT flag.

libhb/common.h
libhb/preset.c

index 7e0a6f31bc296a4b46c33c1ee5f1dde70b4d21e6..dcd4640acdebd8497adc5a642381ec9ba7281e69 100644 (file)
@@ -749,6 +749,9 @@ struct hb_job_s
 #define HB_AUDIO_ATTR_ALT_COMMENTARY    0x08
 #define HB_AUDIO_ATTR_SECONDARY         0x10
 #define HB_AUDIO_ATTR_DEFAULT           0x20
+// This mask should contain all attributes that are allowed for default
+// audio track selection
+#define HB_AUDIO_ATTR_REGULAR_MASK      0x21
 
 // Update win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio_config_s.cs when changing this struct
 struct hb_audio_config_s
index 8aecdccff0eeda613ffc1a87165627094de4ed23..2d05b1c720e5a9af0a18f78407f8128a2507de55 100644 (file)
@@ -405,7 +405,7 @@ static int find_audio_track(const hb_title_t *title,
         // allow any audio track type
         if ((behavior == 2 ||
              audio->lang.attributes == HB_AUDIO_ATTR_NONE ||
-             audio->lang.attributes == HB_AUDIO_ATTR_NORMAL) &&
+             (audio->lang.attributes & HB_AUDIO_ATTR_REGULAR_MASK)) &&
             (!strcmp(lang, audio->lang.iso639_2) || !strcmp(lang, "und")))
         {
             return ii;