From 2a76ad096d0c24c5cad8bf9a9ce42278eccc61ec Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 9 Jan 2025 20:16:14 +0100 Subject: [PATCH] Fix ALSA HW params pre-fill for non hardware PCMs Fixes #7 --- CMakeLists.txt | 4 ++-- src/main.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cfdcd36..b7cea78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,10 @@ # SPDX-FileCopyrightText: 2014-2025 Arkadiusz Bokowy and contributors # SPDX-License-Identifier: MIT -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.11) project(svar - VERSION 1.2.0 + VERSION 1.2.1 DESCRIPTION "Simple Voice Activated Recorder" LANGUAGES C) diff --git a/src/main.c b/src/main.c index 998d973..dc9feb4 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,6 @@ /* * SVAR - main.c - * SPDX-FileCopyrightText: 2010-2021 Arkadiusz Bokowy and contributors + * SPDX-FileCopyrightText: 2010-2025 Arkadiusz Bokowy and contributors * SPDX-License-Identifier: MIT */ @@ -172,7 +172,7 @@ static int pcm_set_hw_params(snd_pcm_t *pcm, char **msg) { snd_pcm_hw_params_alloca(¶ms); - if ((err = snd_pcm_hw_params_any(pcm, params)) != 0) { + if ((err = snd_pcm_hw_params_any(pcm, params)) < 0) { snprintf(buf, sizeof(buf), "Set all possible ranges: %s", snd_strerror(err)); goto fail; }