summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/resampler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/resampler.c')
-rw-r--r--src/pulsecore/resampler.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index dd379b8a..c1af401c 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -741,13 +741,14 @@ static void speex_update_rates(pa_resampler *r) {
static void speex_free(pa_resampler *r) {
pa_assert(r);
- if (r->speex.state) {
- if (r->resample_method >= PA_RESAMPLER_SPEEX_FIXED_BASE && r->resample_method <= PA_RESAMPLER_SPEEX_FIXED_MAX)
- paspfx_resampler_destroy(r->speex.state);
- else {
- pa_assert(r->resample_method >= PA_RESAMPLER_SPEEX_FLOAT_BASE && r->resample_method <= PA_RESAMPLER_SPEEX_FLOAT_MAX);
- paspfl_resampler_destroy(r->speex.state);
- }
+ if (!r->speex.state)
+ return;
+
+ if (r->resample_method >= PA_RESAMPLER_SPEEX_FIXED_BASE && r->resample_method <= PA_RESAMPLER_SPEEX_FIXED_MAX)
+ paspfx_resampler_destroy(r->speex.state);
+ else {
+ pa_assert(r->resample_method >= PA_RESAMPLER_SPEEX_FLOAT_BASE && r->resample_method <= PA_RESAMPLER_SPEEX_FLOAT_MAX);
+ paspfl_resampler_destroy(r->speex.state);
}
}
@@ -761,20 +762,24 @@ static int speex_init(pa_resampler *r) {
if (r->resample_method >= PA_RESAMPLER_SPEEX_FIXED_BASE && r->resample_method <= PA_RESAMPLER_SPEEX_FIXED_MAX) {
q = r->resample_method - PA_RESAMPLER_SPEEX_FIXED_BASE;
- r->impl_resample = speex_resample_int;
+ pa_log_info("Choosing speex quality setting %i.", q);
+
if (!(r->speex.state = paspfx_resampler_init(r->o_ss.channels, r->i_ss.rate, r->o_ss.rate, q, &err)))
return -1;
+ r->impl_resample = speex_resample_int;
} else {
pa_assert(r->resample_method >= PA_RESAMPLER_SPEEX_FLOAT_BASE && r->resample_method <= PA_RESAMPLER_SPEEX_FLOAT_MAX);
q = r->resample_method - PA_RESAMPLER_SPEEX_FLOAT_BASE;
- r->impl_resample = speex_resample_float;
+ pa_log_info("Choosing speex quality setting %i.", q);
+
if (!(r->speex.state = paspfl_resampler_init(r->o_ss.channels, r->i_ss.rate, r->o_ss.rate, q, &err)))
return -1;
+
+ r->impl_resample = speex_resample_float;
}
-
return 0;
}