From 5eee28e37d78e0679fc5aa8488e5408429153e4c Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 12 Oct 2017 03:12:58 -0400 Subject: Nitpick configuration code in a few DSP filters to fix some bugs Most importantly is surround shouldn't operate in mono mode. Have it watch and (de)activate itself on relevant format changes as it should. Other changes to better handle buffer allocation failure. PBE was set internally at 100 by default; SBZ. Change-Id: I328e0b674e56751a255eae817d7892d685796b06 --- lib/rbcodec/dsp/afr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rbcodec/dsp/afr.c') diff --git a/lib/rbcodec/dsp/afr.c b/lib/rbcodec/dsp/afr.c index b266e4b549..d9b6ef97a4 100644 --- a/lib/rbcodec/dsp/afr.c +++ b/lib/rbcodec/dsp/afr.c @@ -77,9 +77,10 @@ void dsp_afr_enable(int var) if (var == afr_strength) return; /* No setting change */ - bool was_enabled = afr_strength > 0; afr_strength = var; + struct dsp_config *dsp = dsp_get_config(CODEC_IDX_AUDIO); + bool was_enabled = dsp_proc_enabled(dsp, DSP_PROC_AFR); bool now_enabled = var > 0; if (was_enabled == now_enabled && !now_enabled) @@ -88,7 +89,6 @@ void dsp_afr_enable(int var) /* If changing status, enable or disable it; if already enabled push additional DSP_PROC_INIT messages with value = 1 to force-update the filters */ - struct dsp_config *dsp = dsp_get_config(CODEC_IDX_AUDIO); dsp_proc_enable(dsp, DSP_PROC_AFR, now_enabled); } -- cgit v1.2.3