From c5cd65d81e98f96c761803f12fd3ae159fced556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?poljar=20=28Damir=20Jeli=C4=87=29?= Date: Fri, 28 Jun 2013 18:55:04 +0200 Subject: [PATCH] Resampler: Don't use the peaks resampler for upsampling This patch fixes this assertion: Assertion 'r->i_ss.rate >= r->o_ss.rate' failed at ../../src/pulsecore/resampler.c:1744, function peaks_init(). Aborting. --- src/pulsecore/resampler.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c index 446ddff67..eda623615 100644 --- a/src/pulsecore/resampler.c +++ b/src/pulsecore/resampler.c @@ -226,6 +226,16 @@ static pa_resample_method_t pa_resampler_fix_method( method = PA_RESAMPLER_AUTO; } break; + + /* The Peaks resampler only supports downsampling. + * Revert to auto if we are upsampling */ + case PA_RESAMPLER_PEAKS: + if (rate_a < rate_b) { + pa_log_warn("The 'peaks' resampler only supports downsampling, reverting to resampler 'auto'."); + method = PA_RESAMPLER_AUTO; + } + break; + default: break; }