From 7f002f6276450597b1b2790ac50f2375079b7ce2 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Wed, 6 Nov 2024 20:54:01 +0100 Subject: [PATCH] add lower limit to network source samplerate --- source_modules/network_source/src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source_modules/network_source/src/main.cpp b/source_modules/network_source/src/main.cpp index ffc11d22..4dfa5cdc 100644 --- a/source_modules/network_source/src/main.cpp +++ b/source_modules/network_source/src/main.cpp @@ -250,7 +250,10 @@ private: // Samplerate selector SmGui::LeftLabel("Samplerate"); SmGui::FillWidth(); - SmGui::InputInt(("##network_source_sr_" + _this->name).c_str(), &_this->tempSamplerate); + if (SmGui::InputInt(("##network_source_sr_" + _this->name).c_str(), &_this->tempSamplerate)) { + // Prevent silly values from silly users + _this->tempSamplerate = std::max(_this->tempSamplerate, 1000); + } bool applyEn = (!_this->running && _this->tempSamplerate != _this->samplerate); if (!applyEn) { SmGui::BeginDisabled(); } SmGui::FillWidth();