diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2012-12-19 17:34:57 -0500 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-05-04 13:43:33 -0400 |
commit | 78a45b47dede5ddf35dfc53e965b486a79177b18 (patch) | |
tree | edb3ad7c101e600a7cc3be4b40380430cbeb3e55 /lib/rbcodec/dsp/tone_controls.c | |
parent | cdb71c707bb434f44368b72f2db3becc37b7a46c (diff) | |
download | rockbox-78a45b47dede5ddf35dfc53e965b486a79177b18.tar.gz rockbox-78a45b47dede5ddf35dfc53e965b486a79177b18.zip |
Cleanup and simplify latest DSP code incarnation.
Some things can just be a bit simpler in handling the list of stages
and some things, especially format change handling, can be simplified
for each stage implementation. Format changes are sent through the
configure() callback.
Hide some internal details and variables from processing stages and
let the core deal with it.
Do some miscellaneous cleanup and keep things a bit better factored.
Change-Id: I19dd8ce1d0b792ba914d426013088a49a52ecb7e
Diffstat (limited to 'lib/rbcodec/dsp/tone_controls.c')
-rw-r--r-- | lib/rbcodec/dsp/tone_controls.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/rbcodec/dsp/tone_controls.c b/lib/rbcodec/dsp/tone_controls.c index 922c966e3f..01381ea330 100644 --- a/lib/rbcodec/dsp/tone_controls.c +++ b/lib/rbcodec/dsp/tone_controls.c | |||
@@ -90,7 +90,7 @@ static void tone_process(struct dsp_proc_entry *this, | |||
90 | struct dsp_buffer **buf_p) | 90 | struct dsp_buffer **buf_p) |
91 | { | 91 | { |
92 | struct dsp_buffer *buf = *buf_p; | 92 | struct dsp_buffer *buf = *buf_p; |
93 | filter_process((void *)this->data, buf->p32, buf->remcount, | 93 | filter_process((struct dsp_filter *)this->data, buf->p32, buf->remcount, |
94 | buf->format.num_channels); | 94 | buf->format.num_channels); |
95 | } | 95 | } |
96 | 96 | ||
@@ -104,15 +104,17 @@ static intptr_t tone_configure(struct dsp_proc_entry *this, | |||
104 | { | 104 | { |
105 | case DSP_PROC_INIT: | 105 | case DSP_PROC_INIT: |
106 | if (value != 0) | 106 | if (value != 0) |
107 | break; | 107 | break; /* Already enabled */ |
108 | |||
108 | this->data = (intptr_t)&tone_filters[dsp_get_id(dsp)]; | 109 | this->data = (intptr_t)&tone_filters[dsp_get_id(dsp)]; |
109 | this->process[0] = tone_process; | 110 | this->process = tone_process; |
111 | /* Fall-through */ | ||
110 | case DSP_FLUSH: | 112 | case DSP_FLUSH: |
111 | filter_flush((struct dsp_filter *)this->data); | 113 | filter_flush((struct dsp_filter *)this->data); |
112 | break; | 114 | break; |
113 | } | 115 | } |
114 | 116 | ||
115 | return 1; | 117 | return 0; |
116 | } | 118 | } |
117 | 119 | ||
118 | /* Database entry */ | 120 | /* Database entry */ |