From 72b6788c68795e174fa5b9211ee318751f264059 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 7 Sep 2022 19:58:30 +0200 Subject: [PATCH] alsa: don't set impossible rates When the max rate is smaller than the min rate, don't add the DSD format at all because it is not possible to play it. See #93 --- spa/plugins/alsa/alsa-pcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 013a61962..9453da3e8 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -799,6 +799,8 @@ static int add_rate(struct state *state, uint32_t scale, bool all, uint32_t inde min_allowed_rate /= scale; min = SPA_MAX(min_allowed_rate, min); + if (max < min) + return 0; if (!state->multi_rate && state->card->format_ref > 0) rate = state->card->rate;