From 0f6e34a6973118a4ee7abfc4252b49bd88b85ed9 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 30 Jun 2021 04:10:25 +0200 Subject: [PATCH] ALSA: fix idempotent device name setup This fixes an edge case where available buffersizes are not not correctly set because the device info was never queried. --- libs/backends/alsa/alsa_audiobackend.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index 3bae142d17..b5d04fbfe1 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -322,7 +322,7 @@ AlsaAudioBackend::can_change_buffer_size_when_running () const int AlsaAudioBackend::set_input_device_name (const std::string& d) { - if (_input_audio_device == d) { + if (_input_audio_device == d && _input_audio_device_info.valid) { return 0; } _input_audio_device = d; @@ -353,7 +353,7 @@ AlsaAudioBackend::set_input_device_name (const std::string& d) int AlsaAudioBackend::set_output_device_name (const std::string& d) { - if (_output_audio_device == d) { + if (_output_audio_device == d && _output_audio_device_info.valid) { return 0; }