From 1bd39979930888eaa6061d17cc5122f970d3d66e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 12 Sep 2016 01:09:04 +0200 Subject: [PATCH] Make sure AudioDevice::name is set for ALSA cards, not just video capture cards. --- alsa_input.cpp | 7 ++++--- audio_mixer.cpp | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/alsa_input.cpp b/alsa_input.cpp index 09cbbd2..7594bbb 100644 --- a/alsa_input.cpp +++ b/alsa_input.cpp @@ -467,9 +467,10 @@ ALSAPool::ProbeResult ALSAPool::probe_device_once(unsigned card_index, unsigned fprintf(stderr, "%s: Probed successfully.\n", address); reset_device(internal_dev_index); // Restarts it if it is held (ie., we just replaced a dead card). - if (global_audio_mixer) { - global_audio_mixer->trigger_state_changed_callback(); - } + + DeviceSpec spec{InputSourceType::ALSA_INPUT, internal_dev_index}; + global_audio_mixer->set_name(spec, name + " (" + info + ")"); + global_audio_mixer->trigger_state_changed_callback(); return ALSAPool::ProbeResult::SUCCESS; } diff --git a/audio_mixer.cpp b/audio_mixer.cpp index a2f25f0..cf2c944 100644 --- a/audio_mixer.cpp +++ b/audio_mixer.cpp @@ -162,6 +162,8 @@ AudioMixer::AudioMixer(unsigned num_cards) limiter(OUTPUT_FREQUENCY), correlation(OUTPUT_FREQUENCY) { + global_audio_mixer = this; + for (unsigned bus_index = 0; bus_index < MAX_BUSES; ++bus_index) { locut[bus_index].init(FILTER_HPF, 2); locut_enabled[bus_index] = global_flags.locut_enabled; -- 2.39.2