From 7448ef14baf3725ce465858262a5541bdd9c5f18 Mon Sep 17 00:00:00 2001 From: Niels Ole Salscheider Date: Fri, 5 Oct 2012 21:46:49 +0200 Subject: [PATCH] virtual-surround: Limit the number of hrir samples. v2: better log message --- src/modules/module-virtual-surround-sink.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/module-virtual-surround-sink.c b/src/modules/module-virtual-surround-sink.c index 50f101d..e5c5dc1 100644 --- a/src/modules/module-virtual-surround-sink.c +++ b/src/modules/module-virtual-surround-sink.c @@ -724,6 +724,11 @@ int pa__init(pa_module*m) { PA_RESAMPLER_SRC_SINC_BEST_QUALITY, PA_RESAMPLER_NO_REMAP); u->hrir_samples = hrir_temp_chunk.length / pa_frame_size(&hrir_temp_ss) * hrir_ss.rate / hrir_temp_ss.rate; + if (u->hrir_samples > 64) { + u->hrir_samples = 64; + pa_log("The (resampled) hrir contains more than 64 samples. Only the first 64 samples will be used to limit processor usage."); + } + hrir_total_length = u->hrir_samples * pa_frame_size(&hrir_ss); u->hrir_channels = hrir_ss.channels; -- 2.7.4