Handle Empty Samplerates

Prevents crashes when input/output devices report no sample rates by defaulting to the current rate or 48 kHz if needed

Provides a fallback option in the UI so the selected rate is visible even when the device list is empty
This commit is contained in:
Extremesecrecy
2025-07-23 22:12:38 -07:00
parent d98c5c1ae0
commit 69eeeca3fc
@@ -334,6 +334,7 @@ const JackServerSettingsDialog = withStyles(
if (result.sampleRate === 0) result.sampleRate = 48000;
let sampleRates = intersectArrays(inDevice.sampleRates, outDevice.sampleRates);
if (sampleRates.length === 0) sampleRates = inDevice.sampleRates;
if (sampleRates.length === 0) sampleRates = [result.sampleRate || 48000];
let bestSr = sampleRates[0];
let bestErr = 1e36;
for (let sr of sampleRates) {