From a4a401c11a71dd7d3d45e13b701551d7b66173d6 Mon Sep 17 00:00:00 2001 From: fwcd Date: Sat, 9 Sep 2023 16:07:36 +0200 Subject: [PATCH] DlgPrefSound: Fix fetching of sample rate --- src/preferences/dialog/dlgprefsound.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/preferences/dialog/dlgprefsound.cpp b/src/preferences/dialog/dlgprefsound.cpp index 191473ccc31..a4bee2cb26f 100644 --- a/src/preferences/dialog/dlgprefsound.cpp +++ b/src/preferences/dialog/dlgprefsound.cpp @@ -608,7 +608,11 @@ void DlgPrefSound::updateAudioBufferSizes(int sampleRateIndex) { static_cast(SoundManagerConfig:: JackAudioBufferSizeIndex::Size4096fpp)); } else { - double sampleRate = sampleRateComboBox->itemData(sampleRateIndex).toDouble(); + DEBUG_ASSERT(sampleRateComboBox->itemData(sampleRateIndex) + .canConvert()); + double sampleRate = sampleRateComboBox->itemData(sampleRateIndex) + .value() + .toDouble(); unsigned int framesPerBuffer = 1; // start this at 0 and inf loop happens // we don't want to display any sub-1ms buffer sizes (well maybe we do but I // don't right now!), so we iterate over all the buffer sizes until we