mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
resampler: Add assert to set_input/output_rate
This adds asserts to check if the implementation has an update rate function defined for the unlikely event that some implementation forgets to assign a update rate function we can simply bail. It is expected from the resampling implementations to have such a function even if the state of the resampler is completely reset.
This commit is contained in:
parent
4bdfebee5c
commit
0d525e9c85
1 changed files with 2 additions and 0 deletions
|
|
@ -460,6 +460,7 @@ void pa_resampler_free(pa_resampler *r) {
|
|||
void pa_resampler_set_input_rate(pa_resampler *r, uint32_t rate) {
|
||||
pa_assert(r);
|
||||
pa_assert(rate > 0);
|
||||
pa_assert(r->impl.update_rates);
|
||||
|
||||
if (r->i_ss.rate == rate)
|
||||
return;
|
||||
|
|
@ -472,6 +473,7 @@ void pa_resampler_set_input_rate(pa_resampler *r, uint32_t rate) {
|
|||
void pa_resampler_set_output_rate(pa_resampler *r, uint32_t rate) {
|
||||
pa_assert(r);
|
||||
pa_assert(rate > 0);
|
||||
pa_assert(r->impl.update_rates);
|
||||
|
||||
if (r->o_ss.rate == rate)
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue