diff --git a/plutosdr_source/src/main.cpp b/plutosdr_source/src/main.cpp index 6186da38..582380f6 100644 --- a/plutosdr_source/src/main.cpp +++ b/plutosdr_source/src/main.cpp @@ -170,11 +170,13 @@ private: ImGui::SetNextItemWidth(menuWidth - ImGui::GetCursorPosX()); if (_this->running) { style::beginDisabled(); } if (ImGui::InputFloat(CONCAT("##_samplerate_select_", _this->name), &_this->sampleRate, 1, 1000, 0)) { - _this->sampleRate = std::clamp(_this->sampleRate, 500000, 61000000); - core::setInputSampleRate(_this->sampleRate); - config.aquire(); - config.conf["sampleRate"] = _this->sampleRate; - config.release(true); + if (_this->sampleRate > 0) { + _this->sampleRate = std::clamp(_this->sampleRate, 500000, 61000000); + core::setInputSampleRate(_this->sampleRate); + config.aquire(); + config.conf["sampleRate"] = _this->sampleRate; + config.release(true); + } } if (_this->running) { style::endDisabled(); }