mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-24 11:04:10 -04:00
AudioDeviceManager: make sure a negative or null sample rate is never returned
This commit is contained in:
@@ -503,7 +503,15 @@ int AudioDeviceManager::getInputSampleRate(int inputDeviceIndex)
|
||||
}
|
||||
else
|
||||
{
|
||||
return deviceInfo.sampleRate;
|
||||
if (deviceInfo.sampleRate > 0)
|
||||
{
|
||||
return deviceInfo.sampleRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("AudioDeviceManager::getInputSampleRate: device %s has invalid sample rate", qPrintable(deviceName));
|
||||
return m_defaultAudioSampleRate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +534,15 @@ int AudioDeviceManager::getOutputSampleRate(int outputDeviceIndex)
|
||||
}
|
||||
else
|
||||
{
|
||||
return deviceInfo.sampleRate;
|
||||
if (deviceInfo.sampleRate > 0)
|
||||
{
|
||||
return deviceInfo.sampleRate;
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug("AudioDeviceManager::getOutputSampleRate: device %s has invalid sample rate", qPrintable(deviceName));
|
||||
return m_defaultAudioSampleRate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user