[PATCH 09/18] resampler: Add assert to set_input/output_rate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds asserts to check if the implementation has an update rate
function defined.
---
 src/pulsecore/resampler.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index ea5f1aa..35342af 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -456,6 +456,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->implementation.update_rates);
 
     if (r->i_ss.rate == rate)
         return;
@@ -468,6 +469,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->implementation.update_rates);
 
     if (r->o_ss.rate == rate)
         return;
-- 
1.8.3.2



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux