Skip to content

Commit 6a31851

Browse files
committed
KernelAudio: prevent assertion/crash if JACK has no sample rates available to choose from
KernelAudio just returns an invalid configuration object.
1 parent 6175788 commit 6a31851

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/kernelAudio.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,11 @@ KernelAudio::OpenStreamResult KernelAudio::openStream_(
387387
{
388388
const Device jackDevice = fetchDevice(out.id); // JACK has only one device
389389

390-
assert(jackDevice.sampleRates.size() > 0);
390+
if (jackDevice.sampleRates.size() == 0)
391+
{
392+
u::log::print("[KA] JACK has no sample rates! Can't proceed\n");
393+
return {};
394+
}
391395

392396
const unsigned int jackSampleRate = jackDevice.sampleRates[0];
393397

0 commit comments

Comments
 (0)