lfe-filter: Add rewind support

Store current filter state at every normal block process.
When a rewind happens, rewind back to the nearest saved state,
then calculate forward to the actual sample position.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
David Henningsson 2015-03-24 10:29:17 +01:00
parent d0e8b0fe07
commit defc2b702b
3 changed files with 108 additions and 9 deletions

View file

@ -419,7 +419,8 @@ pa_resampler* pa_resampler_new(
if (lfe_filter_required) {
pa_sample_spec wss = r->o_ss;
wss.format = r->work_format;
r->lfe_filter = pa_lfe_filter_new(&wss, &r->o_cm, (float)crossover_freq);
/* FIXME: For now just hardcode maxrewind to 3 seconds */
r->lfe_filter = pa_lfe_filter_new(&wss, &r->o_cm, (float)crossover_freq, b->rate * 3);
pa_log_debug(" lfe filter activated (LR4 type), the crossover_freq = %uHz", crossover_freq);
}