mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -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
|
|
@ -202,8 +202,8 @@ static pa_resample_method_t pa_resampler_fix_method(
|
|||
const uint32_t rate_a,
|
||||
const uint32_t rate_b) {
|
||||
|
||||
pa_assert(rate_a > 0 && rate_a <= PA_RATE_MAX);
|
||||
pa_assert(rate_b > 0 && rate_b <= PA_RATE_MAX);
|
||||
pa_assert(pa_sample_rate_valid(rate_a));
|
||||
pa_assert(pa_sample_rate_valid(rate_b));
|
||||
pa_assert(method >= 0);
|
||||
pa_assert(method < PA_RESAMPLER_MAX);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue