Handle Empty SampleRates Cont

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:14:31 -07:00
parent 69eeeca3fc
commit 85c1e46350
@@ -520,7 +520,8 @@ const JackServerSettingsDialog = withStyles(
let sampleRates = selectedInputDevice && selectedOutputDevice ?
intersectArrays(selectedInputDevice.sampleRates, selectedOutputDevice.sampleRates)
: (selectedInputDevice ? selectedInputDevice.sampleRates : (selectedOutputDevice ? selectedOutputDevice.sampleRates : []));
let sampleRateOptions = sampleRates.length === 0 ? [this.state.jackServerSettings.sampleRate || 48000] : sampleRates;
return (
<DialogEx tag="jack" onClose={handleClose} aria-labelledby="select-channels-title" open={open}
onEnterKey={() => {
@@ -589,7 +590,7 @@ const JackServerSettingsDialog = withStyles(
}
}}
>
{sampleRates.map((sr) => {
{sampleRateOptions.map((sr) => {
return (<MenuItem value={sr}>{sr}</MenuItem> );
})}
</Select>