From 3215c7ee942ce41669c0e731c92a6e4bac07aba9 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Wed, 17 Apr 2024 15:20:10 -0600 Subject: [PATCH] Fix audio selection when behavior is "All" tracks Do not follow linked audio tracks as that will result in the same track being selected multiple times. --- libhb/preset.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libhb/preset.c b/libhb/preset.c index 57d450d0bcf5..bd35ee135fe0 100644 --- a/libhb/preset.c +++ b/libhb/preset.c @@ -812,17 +812,20 @@ static void add_audio_for_lang(hb_value_array_t *list, const hb_dict_t *preset, } hb_audio_config_t * aconfig; - hb_audio_config_t * linked_aconfig; aconfig = hb_list_audio_config_item(title->list_audio, track); - linked_aconfig = best_linked_audio(title->list_audio, aconfig, - out_codec, copy_mask, - mix_channels); - if (aconfig != linked_aconfig) + if (behavior != 2) { - hb_log("Substituting linked audio track %d for track %d\n", - linked_aconfig->index, aconfig->index); - aconfig = linked_aconfig; + hb_audio_config_t * linked_aconfig; + linked_aconfig = best_linked_audio(title->list_audio, aconfig, + out_codec, copy_mask, + mix_channels); + if (aconfig != linked_aconfig) + { + hb_log("Substituting linked audio track %d for track %d\n", + linked_aconfig->index, aconfig->index); + aconfig = linked_aconfig; + } } // Check if this source track has already been added using these