]> git.sesse.net Git - nageru/commitdiff
When hotplugging cards, reset resampler only after the device name and number of...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Jun 2020 19:24:43 +0000 (21:24 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Jun 2020 19:24:43 +0000 (21:24 +0200)
nageru/mixer.cpp

index 827ab9fd9dfa4b41ca31649d7dcd6cb0d09c9434..e61ece2c8158a3a9b7585dca08b87b4429c18691 100644 (file)
@@ -633,7 +633,6 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, CardT
 
        DeviceSpec device;
        device = DeviceSpec{InputSourceType::CAPTURE_CARD, card_index};
-       audio_mixer->reset_resampler(device);
        unsigned num_channels = card_type == CardType::LIVE_CARD ? 8 : 2;
        if (is_active) {
                audio_mixer->set_device_parameters(device, card->capture->get_description(), card_type, num_channels, /*active=*/true);
@@ -643,6 +642,7 @@ void Mixer::configure_card(unsigned card_index, CaptureInterface *capture, CardT
                snprintf(name, sizeof(name), "Fake card %u", card_index + 1);
                audio_mixer->set_device_parameters(device, name, card_type, num_channels, /*active=*/false);
        }
+       audio_mixer->reset_resampler(device);
        audio_mixer->trigger_state_changed_callback();
 
        // Unregister old metrics, if any.