13
0

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.
This commit is contained in:
Robin Gareus 2021-06-30 04:10:25 +02:00
parent 775f46315f
commit 0f6e34a697
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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;
}