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
This commit is contained in:
Wim Taymans 2022-09-07 19:58:30 +02:00
parent 23522651f9
commit 72b6788c68

View file

@ -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;