mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
Add pa_sample_rate_valid()
I think this makes the code a bit nicer to read and write. This also reduces the chances of off-by-one errors when checking the bounds of sample rate values.
This commit is contained in:
parent
1cda717252
commit
a67318f8af
12 changed files with 24 additions and 21 deletions
|
|
@ -1420,8 +1420,7 @@ int pa_sink_update_rate(pa_sink *s, uint32_t rate, bool passthrough) {
|
|||
}
|
||||
}
|
||||
|
||||
if (PA_UNLIKELY (desired_rate < 8000 ||
|
||||
desired_rate > PA_RATE_MAX))
|
||||
if (PA_UNLIKELY(!pa_sample_rate_valid(desired_rate)))
|
||||
return -1;
|
||||
|
||||
if (!passthrough) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue