diff options
author | Thom Johansen <thomj@rockbox.org> | 2005-09-23 00:12:02 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2005-09-23 00:12:02 +0000 |
commit | bccf58621e7852f747196368c1485a48cd3ecd7b (patch) | |
tree | f7f543b7b100e49e2cf91cdcbee0712b28be488d /apps/codecs | |
parent | 06477728269c1766da5255cf992e604cdbf86420 (diff) | |
download | rockbox-bccf58621e7852f747196368c1485a48cd3ecd7b.tar.gz rockbox-bccf58621e7852f747196368c1485a48cd3ecd7b.zip |
Removed unnecessary codec_api struct.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7551 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/wavpack.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/apps/codecs/wavpack.c b/apps/codecs/wavpack.c index 30638f97ca..12a05bbe37 100644 --- a/apps/codecs/wavpack.c +++ b/apps/codecs/wavpack.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include "lib/codeclib.h" | 24 | #include "lib/codeclib.h" |
25 | #include "dsp.h" | 25 | #include "dsp.h" |
26 | 26 | ||
27 | static struct codec_api *rb; | ||
28 | static struct codec_api *ci; | 27 | static struct codec_api *ci; |
29 | 28 | ||
30 | #define BUFFER_SIZE 4096 | 29 | #define BUFFER_SIZE 4096 |
@@ -38,7 +37,7 @@ static long read_callback (void *buffer, long bytes) | |||
38 | return retval; | 37 | return retval; |
39 | } | 38 | } |
40 | 39 | ||
41 | #ifndef SIMULATOR | 40 | #ifdef USE_IRAM |
42 | extern char iramcopy[]; | 41 | extern char iramcopy[]; |
43 | extern char iramstart[]; | 42 | extern char iramstart[]; |
44 | extern char iramend[]; | 43 | extern char iramend[]; |
@@ -54,11 +53,10 @@ enum codec_status codec_start(struct codec_api* api) | |||
54 | /* Generic codec initialisation */ | 53 | /* Generic codec initialisation */ |
55 | TEST_CODEC_API(api); | 54 | TEST_CODEC_API(api); |
56 | 55 | ||
57 | rb = api; | ||
58 | ci = api; | 56 | ci = api; |
59 | 57 | ||
60 | #ifndef SIMULATOR | 58 | #ifdef USE_IRAM |
61 | rb->memcpy(iramstart, iramcopy, iramend-iramstart); | 59 | ci->memcpy(iramstart, iramcopy, iramend-iramstart); |
62 | #endif | 60 | #endif |
63 | 61 | ||
64 | ci->configure(CODEC_SET_FILEBUF_LIMIT, (int *)(1024*1024*10)); | 62 | ci->configure(CODEC_SET_FILEBUF_LIMIT, (int *)(1024*1024*10)); |
@@ -74,14 +72,14 @@ enum codec_status codec_start(struct codec_api* api) | |||
74 | if (codec_init(api)) | 72 | if (codec_init(api)) |
75 | return CODEC_ERROR; | 73 | return CODEC_ERROR; |
76 | 74 | ||
77 | while (!*rb->taginfo_ready && !ci->stop_codec) | 75 | while (!*ci->taginfo_ready && !ci->stop_codec) |
78 | ci->sleep(1); | 76 | ci->sleep(1); |
79 | 77 | ||
80 | if (ci->id3->frequency != NATIVE_FREQUENCY || | 78 | if (ci->id3->frequency != NATIVE_FREQUENCY || |
81 | ci->global_settings->replaygain) { | 79 | ci->global_settings->replaygain) { |
82 | ci->configure(CODEC_DSP_ENABLE, (bool *)true); | 80 | ci->configure(CODEC_DSP_ENABLE, (bool *)true); |
83 | ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency)); | 81 | ci->configure(DSP_SET_FREQUENCY, (long *)(ci->id3->frequency)); |
84 | codec_set_replaygain(rb->id3); | 82 | codec_set_replaygain(ci->id3); |
85 | } | 83 | } |
86 | else | 84 | else |
87 | ci->configure(CODEC_DSP_ENABLE, (bool *)false); | 85 | ci->configure(CODEC_DSP_ENABLE, (bool *)false); |
@@ -127,7 +125,7 @@ enum codec_status codec_start(struct codec_api* api) | |||
127 | break; | 125 | break; |
128 | 126 | ||
129 | ci->set_elapsed (WavpackGetSampleIndex (wpc) / sr_100 * 10); | 127 | ci->set_elapsed (WavpackGetSampleIndex (wpc) / sr_100 * 10); |
130 | rb->yield (); | 128 | ci->yield (); |
131 | } | 129 | } |
132 | 130 | ||
133 | nsamples = WavpackUnpackSamples (wpc, temp_buffer, BUFFER_SIZE / 2); | 131 | nsamples = WavpackUnpackSamples (wpc, temp_buffer, BUFFER_SIZE / 2); |
@@ -146,7 +144,7 @@ enum codec_status codec_start(struct codec_api* api) | |||
146 | *--dst = *--src; | 144 | *--dst = *--src; |
147 | *--dst = *src; | 145 | *--dst = *src; |
148 | if (!(count & 0x7f)) | 146 | if (!(count & 0x7f)) |
149 | rb->yield (); | 147 | ci->yield (); |
150 | } | 148 | } |
151 | } | 149 | } |
152 | 150 | ||
@@ -159,7 +157,7 @@ enum codec_status codec_start(struct codec_api* api) | |||
159 | *dst++ = *src++ << 8; | 157 | *dst++ = *src++ << 8; |
160 | *dst++ = *src++ << 8; | 158 | *dst++ = *src++ << 8; |
161 | if (!(count & 0x7f)) | 159 | if (!(count & 0x7f)) |
162 | rb->yield (); | 160 | ci->yield (); |
163 | } | 161 | } |
164 | } | 162 | } |
165 | else if (bps == 2) { | 163 | else if (bps == 2) { |
@@ -171,7 +169,7 @@ enum codec_status codec_start(struct codec_api* api) | |||
171 | *dst++ = *src++; | 169 | *dst++ = *src++; |
172 | *dst++ = *src++; | 170 | *dst++ = *src++; |
173 | if (!(count & 0x7f)) | 171 | if (!(count & 0x7f)) |
174 | rb->yield (); | 172 | ci->yield (); |
175 | } | 173 | } |
176 | } | 174 | } |
177 | else { | 175 | else { |
@@ -184,7 +182,7 @@ enum codec_status codec_start(struct codec_api* api) | |||
184 | *dst++ = *src++ >> shift; | 182 | *dst++ = *src++ >> shift; |
185 | *dst++ = *src++ >> shift; | 183 | *dst++ = *src++ >> shift; |
186 | if (!(count & 0x7f)) | 184 | if (!(count & 0x7f)) |
187 | rb->yield (); | 185 | ci->yield (); |
188 | } | 186 | } |
189 | } | 187 | } |
190 | 188 | ||
@@ -192,7 +190,7 @@ enum codec_status codec_start(struct codec_api* api) | |||
192 | break; | 190 | break; |
193 | 191 | ||
194 | while (!ci->pcmbuf_insert ((char *) temp_buffer, nsamples * 4)) | 192 | while (!ci->pcmbuf_insert ((char *) temp_buffer, nsamples * 4)) |
195 | rb->sleep (1); | 193 | ci->sleep (1); |
196 | 194 | ||
197 | ci->set_elapsed (WavpackGetSampleIndex (wpc) / sr_100 * 10); | 195 | ci->set_elapsed (WavpackGetSampleIndex (wpc) / sr_100 * 10); |
198 | } | 196 | } |