summaryrefslogtreecommitdiff
path: root/lib/rbcodec/dsp/afr.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-10-12 03:12:58 -0400
committerMichael Sevakis <jethead71@rockbox.org>2017-10-12 04:44:55 -0400
commit5eee28e37d78e0679fc5aa8488e5408429153e4c (patch)
tree8b5593c140fcab4d7a40fc1b9c295a412234048e /lib/rbcodec/dsp/afr.c
parentafbae177a16fafbd898925e874fc56d395756d3a (diff)
downloadrockbox-5eee28e37d78e0679fc5aa8488e5408429153e4c.tar.gz
rockbox-5eee28e37d78e0679fc5aa8488e5408429153e4c.zip
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
Diffstat (limited to 'lib/rbcodec/dsp/afr.c')
-rw-r--r--lib/rbcodec/dsp/afr.c4
1 files changed, 2 insertions, 2 deletions
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)
77 if (var == afr_strength) 77 if (var == afr_strength)
78 return; /* No setting change */ 78 return; /* No setting change */
79 79
80 bool was_enabled = afr_strength > 0;
81 afr_strength = var; 80 afr_strength = var;
82 81
82 struct dsp_config *dsp = dsp_get_config(CODEC_IDX_AUDIO);
83 bool was_enabled = dsp_proc_enabled(dsp, DSP_PROC_AFR);
83 bool now_enabled = var > 0; 84 bool now_enabled = var > 0;
84 85
85 if (was_enabled == now_enabled && !now_enabled) 86 if (was_enabled == now_enabled && !now_enabled)
@@ -88,7 +89,6 @@ void dsp_afr_enable(int var)
88 /* If changing status, enable or disable it; if already enabled push 89 /* If changing status, enable or disable it; if already enabled push
89 additional DSP_PROC_INIT messages with value = 1 to force-update the 90 additional DSP_PROC_INIT messages with value = 1 to force-update the
90 filters */ 91 filters */
91 struct dsp_config *dsp = dsp_get_config(CODEC_IDX_AUDIO);
92 dsp_proc_enable(dsp, DSP_PROC_AFR, now_enabled); 92 dsp_proc_enable(dsp, DSP_PROC_AFR, now_enabled);
93} 93}
94 94