summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-02-10 16:34:16 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-02-10 16:34:16 +0000
commit97f369a5876762a6f4181a8b44c85cb894ebc5f3 (patch)
treecb604ca0ee2fac52bf92635a1c136f1f97f64918
parentce3b774b212defb26f166d77251a11ce14cec73e (diff)
downloadrockbox-97f369a5876762a6f4181a8b44c85cb894ebc5f3.tar.gz
rockbox-97f369a5876762a6f4181a8b44c85cb894ebc5f3.zip
SWCODEC: Annoying neatness update. Use intptr_t for codec_configure_callback and dsp_configure and stop all the silly type casting of intergral types to pointers to set dsp configuration and watermarks. Shouldn't have any effect on already compiled codecs at all. Will fix any important patches in the tracker so they compile.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12259 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs.h2
-rw-r--r--apps/codecs/a52.c8
-rw-r--r--apps/codecs/aac.c10
-rw-r--r--apps/codecs/adx.c12
-rw-r--r--apps/codecs/aiff.c12
-rw-r--r--apps/codecs/alac.c10
-rw-r--r--apps/codecs/flac.c10
-rw-r--r--apps/codecs/mpa.c16
-rw-r--r--apps/codecs/mpc.c16
-rw-r--r--apps/codecs/nsf.c6
-rw-r--r--apps/codecs/shorten.c10
-rw-r--r--apps/codecs/sid.c10
-rw-r--r--apps/codecs/speex.c12
-rw-r--r--apps/codecs/vorbis.c14
-rw-r--r--apps/codecs/wav.c12
-rw-r--r--apps/codecs/wavpack.c10
-rw-r--r--apps/dsp.c18
-rw-r--r--apps/dsp.h2
-rw-r--r--apps/playback.c10
19 files changed, 100 insertions, 100 deletions
diff --git a/apps/codecs.h b/apps/codecs.h
index 993ef3fecb..5d3c7039ff 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -164,7 +164,7 @@ struct codec_api {
164 164
165 void (*set_offset)(size_t value); 165 void (*set_offset)(size_t value);
166 /* Configure different codec buffer parameters. */ 166 /* Configure different codec buffer parameters. */
167 void (*configure)(int setting, void *value); 167 void (*configure)(int setting, intptr_t value);
168 168
169 void (*splash)(int ticks, bool center, const unsigned char *fmt, ...); 169 void (*splash)(int ticks, bool center, const unsigned char *fmt, ...);
170 170
diff --git a/apps/codecs/a52.c b/apps/codecs/a52.c
index 2c74a0f0ea..23f5067d47 100644
--- a/apps/codecs/a52.c
+++ b/apps/codecs/a52.c
@@ -122,9 +122,9 @@ enum codec_status codec_main(void)
122 int retval; 122 int retval;
123 123
124 /* Generic codec initialisation */ 124 /* Generic codec initialisation */
125 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_NONINTERLEAVED); 125 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
126 ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); 126 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
127 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (long *)(1024*128)); 127 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
128 128
129next_track: 129next_track:
130 if (codec_init()) { 130 if (codec_init()) {
@@ -135,7 +135,7 @@ next_track:
135 while (!ci->taginfo_ready) 135 while (!ci->taginfo_ready)
136 ci->yield(); 136 ci->yield();
137 137
138 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); 138 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
139 139
140 /* Intialise the A52 decoder and check for success */ 140 /* Intialise the A52 decoder and check for success */
141 state = a52_init(0); 141 state = a52_init(0);
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c
index 7656c416fe..7c64bc9a31 100644
--- a/apps/codecs/aac.c
+++ b/apps/codecs/aac.c
@@ -51,11 +51,11 @@ enum codec_status codec_main(void)
51 unsigned char c = 0; 51 unsigned char c = 0;
52 52
53 /* Generic codec initialisation */ 53 /* Generic codec initialisation */
54 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*16)); 54 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
55 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); 55 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
56 56
57 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_NONINTERLEAVED); 57 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
58 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(29)); 58 ci->configure(DSP_SET_SAMPLE_DEPTH, 29);
59 59
60next_track: 60next_track:
61 err = CODEC_OK; 61 err = CODEC_OK;
@@ -71,7 +71,7 @@ next_track:
71 71
72 sound_samples_done = ci->id3->offset; 72 sound_samples_done = ci->id3->offset;
73 73
74 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); 74 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
75 codec_set_replaygain(ci->id3); 75 codec_set_replaygain(ci->id3);
76 76
77 stream_create(&input_stream,ci); 77 stream_create(&input_stream,ci);
diff --git a/apps/codecs/adx.c b/apps/codecs/adx.c
index 85e55a4c38..19d8110da6 100644
--- a/apps/codecs/adx.c
+++ b/apps/codecs/adx.c
@@ -54,8 +54,8 @@ enum codec_status codec_main(void)
54 54
55 /* Generic codec initialisation */ 55 /* Generic codec initialisation */
56 /* we only render 16 bits */ 56 /* we only render 16 bits */
57 ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)16); 57 ci->configure(DSP_SET_SAMPLE_DEPTH, 16);
58 /*ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256));*/ 58 /*ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);*/
59 59
60next_track: 60next_track:
61 DEBUGF("ADX: next_track\n"); 61 DEBUGF("ADX: next_track\n");
@@ -73,7 +73,7 @@ next_track:
73 73
74 /* Read the entire file (or as much as possible) */ 74 /* Read the entire file (or as much as possible) */
75 DEBUGF("ADX: request initial buffer\n"); 75 DEBUGF("ADX: request initial buffer\n");
76 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(ci->filesize)); 76 ci->configure(CODEC_SET_FILEBUF_WATERMARK, ci->filesize);
77 ci->seek_buffer(0); 77 ci->seek_buffer(0);
78 buf = ci->request_buffer(&n, ci->filesize); 78 buf = ci->request_buffer(&n, ci->filesize);
79 if (!buf || n < 0x38) { 79 if (!buf || n < 0x38) {
@@ -155,11 +155,11 @@ next_track:
155 bufoff = chanstart; 155 bufoff = chanstart;
156 156
157 /* setup pcm buffer format */ 157 /* setup pcm buffer format */
158 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); 158 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
159 if (channels == 2) { 159 if (channels == 2) {
160 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_INTERLEAVED); 160 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
161 } else if (channels == 1) { 161 } else if (channels == 1) {
162 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_MONO); 162 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
163 } else { 163 } else {
164 DEBUGF("ADX CODEC_ERROR: more than 2 channels\n"); 164 DEBUGF("ADX CODEC_ERROR: more than 2 channels\n");
165 return CODEC_ERROR; 165 return CODEC_ERROR;
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c
index 628f9948ea..2e92d9353f 100644
--- a/apps/codecs/aiff.c
+++ b/apps/codecs/aiff.c
@@ -63,9 +63,9 @@ enum codec_status codec_main(void)
63 off_t firstblockposn; /* position of the first block in file */ 63 off_t firstblockposn; /* position of the first block in file */
64 64
65 /* Generic codec initialisation */ 65 /* Generic codec initialisation */
66 ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); 66 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
67 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); 67 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
68 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256)); 68 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
69 69
70next_track: 70next_track:
71 if (codec_init()) { 71 if (codec_init()) {
@@ -165,12 +165,12 @@ next_track:
165 goto done; 165 goto done;
166 } 166 }
167 167
168 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); 168 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
169 169
170 if (num_channels == 2) { 170 if (num_channels == 2) {
171 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_INTERLEAVED); 171 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
172 } else if (num_channels == 1) { 172 } else if (num_channels == 1) {
173 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_MONO); 173 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
174 } else { 174 } else {
175 DEBUGF("CODEC_ERROR: more than 2 channels unsupported\n"); 175 DEBUGF("CODEC_ERROR: more than 2 channels unsupported\n");
176 i = CODEC_ERROR; 176 i = CODEC_ERROR;
diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c
index cfa713a29a..ca62538a66 100644
--- a/apps/codecs/alac.c
+++ b/apps/codecs/alac.c
@@ -42,11 +42,11 @@ enum codec_status codec_main(void)
42 int retval; 42 int retval;
43 43
44 /* Generic codec initialisation */ 44 /* Generic codec initialisation */
45 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); 45 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
46 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*128)); 46 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
47 47
48 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_NONINTERLEAVED); 48 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
49 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(ALAC_OUTPUT_DEPTH-1)); 49 ci->configure(DSP_SET_SAMPLE_DEPTH, ALAC_OUTPUT_DEPTH-1);
50 50
51 next_track: 51 next_track:
52 52
@@ -59,7 +59,7 @@ enum codec_status codec_main(void)
59 while (!*ci->taginfo_ready && !ci->stop_codec) 59 while (!*ci->taginfo_ready && !ci->stop_codec)
60 ci->sleep(1); 60 ci->sleep(1);
61 61
62 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); 62 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
63 codec_set_replaygain(ci->id3); 63 codec_set_replaygain(ci->id3);
64 64
65 stream_create(&input_stream,ci); 65 stream_create(&input_stream,ci);
diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c
index 738e4bb391..00e0a1f242 100644
--- a/apps/codecs/flac.c
+++ b/apps/codecs/flac.c
@@ -425,10 +425,10 @@ enum codec_status codec_main(void)
425 int retval; 425 int retval;
426 426
427 /* Generic codec initialisation */ 427 /* Generic codec initialisation */
428 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); 428 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
429 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*128)); 429 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
430 430
431 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(FLAC_OUTPUT_DEPTH-1)); 431 ci->configure(DSP_SET_SAMPLE_DEPTH, FLAC_OUTPUT_DEPTH-1);
432 432
433 next_track: 433 next_track:
434 434
@@ -450,9 +450,9 @@ enum codec_status codec_main(void)
450 while (!*ci->taginfo_ready && !ci->stop_codec) 450 while (!*ci->taginfo_ready && !ci->stop_codec)
451 ci->sleep(1); 451 ci->sleep(1);
452 452
453 ci->configure(DSP_SWITCH_FREQUENCY, (int *)(ci->id3->frequency)); 453 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
454 ci->configure(DSP_SET_STEREO_MODE, fc.channels == 1 ? 454 ci->configure(DSP_SET_STEREO_MODE, fc.channels == 1 ?
455 (int *)STEREO_MONO : (int *)STEREO_NONINTERLEAVED); 455 STEREO_MONO : STEREO_NONINTERLEAVED);
456 codec_set_replaygain(ci->id3); 456 codec_set_replaygain(ci->id3);
457 457
458 if (samplesdone) { 458 if (samplesdone) {
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c
index 4c99778071..7bc546b1aa 100644
--- a/apps/codecs/mpa.c
+++ b/apps/codecs/mpa.c
@@ -78,10 +78,10 @@ enum codec_status codec_main(void)
78 78
79 /* Create a decoder instance */ 79 /* Create a decoder instance */
80 80
81 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(MAD_F_FRACBITS)); 81 ci->configure(DSP_SET_SAMPLE_DEPTH, MAD_F_FRACBITS);
82 ci->configure(DSP_SET_CLIP_MIN, (int *)-MAD_F_ONE); 82 ci->configure(DSP_SET_CLIP_MIN, -MAD_F_ONE);
83 ci->configure(DSP_SET_CLIP_MAX, (int *)(MAD_F_ONE - 1)); 83 ci->configure(DSP_SET_CLIP_MAX, MAD_F_ONE - 1);
84 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*16)); 84 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
85 85
86next_track: 86next_track:
87 status = CODEC_OK; 87 status = CODEC_OK;
@@ -93,7 +93,7 @@ next_track:
93 while (!*ci->taginfo_ready && !ci->stop_codec) 93 while (!*ci->taginfo_ready && !ci->stop_codec)
94 ci->sleep(1); 94 ci->sleep(1);
95 95
96 ci->configure(DSP_SWITCH_FREQUENCY, (int *)ci->id3->frequency); 96 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
97 current_frequency = ci->id3->frequency; 97 current_frequency = ci->id3->frequency;
98 codec_set_replaygain(ci->id3); 98 codec_set_replaygain(ci->id3);
99 99
@@ -212,16 +212,16 @@ next_track:
212 /* Check if sample rate and stereo settings changed in this frame. */ 212 /* Check if sample rate and stereo settings changed in this frame. */
213 if (frame.header.samplerate != current_frequency) { 213 if (frame.header.samplerate != current_frequency) {
214 current_frequency = frame.header.samplerate; 214 current_frequency = frame.header.samplerate;
215 ci->configure(DSP_SWITCH_FREQUENCY, (int *)current_frequency); 215 ci->configure(DSP_SWITCH_FREQUENCY, current_frequency);
216 } 216 }
217 if (MAD_NCHANNELS(&frame.header) == 2) { 217 if (MAD_NCHANNELS(&frame.header) == 2) {
218 if (current_stereo_mode != STEREO_NONINTERLEAVED) { 218 if (current_stereo_mode != STEREO_NONINTERLEAVED) {
219 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_NONINTERLEAVED); 219 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
220 current_stereo_mode = STEREO_NONINTERLEAVED; 220 current_stereo_mode = STEREO_NONINTERLEAVED;
221 } 221 }
222 } else { 222 } else {
223 if (current_stereo_mode != STEREO_MONO) { 223 if (current_stereo_mode != STEREO_MONO) {
224 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_MONO); 224 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
225 current_stereo_mode = STEREO_MONO; 225 current_stereo_mode = STEREO_MONO;
226 } 226 }
227 } 227 }
diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c
index 8aba8e50c2..fe22c8cccb 100644
--- a/apps/codecs/mpc.c
+++ b/apps/codecs/mpc.c
@@ -77,9 +77,9 @@ enum codec_status codec_main(void)
77 mpc_streaminfo info; 77 mpc_streaminfo info;
78 int retval = CODEC_OK; 78 int retval = CODEC_OK;
79 79
80 ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)(28)); 80 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
81 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (long *)(1024*16)); 81 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
82 ci->configure(CODEC_SET_FILEBUF_PRESEEK, (long *)(0)); 82 ci->configure(CODEC_SET_FILEBUF_PRESEEK, 0);
83 83
84 /* Create a decoder instance */ 84 /* Create a decoder instance */
85 reader.read = read_impl; 85 reader.read = read_impl;
@@ -107,15 +107,15 @@ next_track:
107 goto done; 107 goto done;
108 } 108 }
109 frequency = info.sample_freq / 1000; 109 frequency = info.sample_freq / 1000;
110 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(long)info.sample_freq); 110 ci->configure(DSP_SWITCH_FREQUENCY, info.sample_freq);
111 111
112 /* set playback engine up for correct number of channels */ 112 /* set playback engine up for correct number of channels */
113 /* NOTE: current musepack format only allows for stereo files 113 /* NOTE: current musepack format only allows for stereo files
114 but code is here to handle other configurations anyway */ 114 but code is here to handle other configurations anyway */
115 if (info.channels == 2) 115 if (info.channels == 2)
116 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_NONINTERLEAVED); 116 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
117 else if (info.channels == 1) 117 else if (info.channels == 1)
118 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_MONO); 118 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
119 else { 119 else {
120 retval = CODEC_ERROR; 120 retval = CODEC_ERROR;
121 goto done; 121 goto done;
@@ -136,7 +136,7 @@ next_track:
136 /* Complete seek handler. */ 136 /* Complete seek handler. */
137 if (ci->seek_time) { 137 if (ci->seek_time) {
138 /* hack to improve seek time if filebuf goes empty */ 138 /* hack to improve seek time if filebuf goes empty */
139 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (long *)(1024*512)); 139 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*512);
140 mpc_int64_t new_offset = (ci->seek_time - 1)*frequency; 140 mpc_int64_t new_offset = (ci->seek_time - 1)*frequency;
141 if (mpc_decoder_seek_sample(&decoder, new_offset)) { 141 if (mpc_decoder_seek_sample(&decoder, new_offset)) {
142 samplesdone = new_offset; 142 samplesdone = new_offset;
@@ -144,7 +144,7 @@ next_track:
144 } 144 }
145 ci->seek_complete(); 145 ci->seek_complete();
146 /* reset chunksize */ 146 /* reset chunksize */
147 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (long *)(1024*16)); 147 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*16);
148 148
149 } 149 }
150 #else 150 #else
diff --git a/apps/codecs/nsf.c b/apps/codecs/nsf.c
index bdea847673..0ca1275d5e 100644
--- a/apps/codecs/nsf.c
+++ b/apps/codecs/nsf.c
@@ -4321,10 +4321,10 @@ enum codec_status codec_main(void)
4321 int usingplaylist; 4321 int usingplaylist;
4322 4322
4323 /* we only render 16 bits */ 4323 /* we only render 16 bits */
4324 ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)16); 4324 ci->configure(DSP_SET_SAMPLE_DEPTH, 16);
4325 4325
4326 ci->configure(DSP_SET_FREQUENCY, (long*)44100); 4326 ci->configure(DSP_SET_FREQUENCY, 44100);
4327 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_MONO); 4327 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
4328 4328
4329 RebuildOutputTables(); 4329 RebuildOutputTables();
4330 4330
diff --git a/apps/codecs/shorten.c b/apps/codecs/shorten.c
index 3c099bc031..dbfc272c5a 100644
--- a/apps/codecs/shorten.c
+++ b/apps/codecs/shorten.c
@@ -45,11 +45,11 @@ enum codec_status codec_main(void)
45 size_t bytesleft; 45 size_t bytesleft;
46 46
47 /* Generic codec initialisation */ 47 /* Generic codec initialisation */
48 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); 48 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
49 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*128)); 49 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
50 50
51 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_NONINTERLEAVED); 51 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
52 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(SHN_OUTPUT_DEPTH-1)); 52 ci->configure(DSP_SET_SAMPLE_DEPTH, SHN_OUTPUT_DEPTH-1);
53 53
54next_track: 54next_track:
55 /* Codec initialization */ 55 /* Codec initialization */
@@ -79,7 +79,7 @@ next_track:
79 } 79 }
80 80
81 ci->id3->frequency = sc.sample_rate; 81 ci->id3->frequency = sc.sample_rate;
82 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(long)(sc.sample_rate)); 82 ci->configure(DSP_SWITCH_FREQUENCY, sc.sample_rate);
83 83
84 if (sc.sample_rate) { 84 if (sc.sample_rate) {
85 ci->id3->length = (sc.totalsamples / sc.sample_rate) * 1000; 85 ci->id3->length = (sc.totalsamples / sc.sample_rate) * 1000;
diff --git a/apps/codecs/sid.c b/apps/codecs/sid.c
index 59683e9b6a..7c53e8f189 100644
--- a/apps/codecs/sid.c
+++ b/apps/codecs/sid.c
@@ -1216,8 +1216,8 @@ enum codec_status codec_main(void)
1216 int nSamplesToRender = 0; 1216 int nSamplesToRender = 0;
1217 1217
1218 /* Generic codec initialisation */ 1218 /* Generic codec initialisation */
1219 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); 1219 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
1220 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256)); 1220 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
1221 1221
1222next_track: 1222next_track:
1223 if (codec_init()) { 1223 if (codec_init()) {
@@ -1246,11 +1246,11 @@ next_track:
1246 1246
1247 1247
1248 /* Make use of 44.1khz */ 1248 /* Make use of 44.1khz */
1249 ci->configure(DSP_SWITCH_FREQUENCY, (long *)44100); 1249 ci->configure(DSP_SWITCH_FREQUENCY, 44100);
1250 /* Sample depth is 28 bit host endian */ 1250 /* Sample depth is 28 bit host endian */
1251 ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); 1251 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
1252 /* Mono output */ 1252 /* Mono output */
1253 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_MONO); 1253 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
1254 1254
1255 1255
1256 /* Set the elapsed time to the current subsong (in seconds) */ 1256 /* Set the elapsed time to the current subsong (in seconds) */
diff --git a/apps/codecs/speex.c b/apps/codecs/speex.c
index 12d880c045..a9b333b9a6 100644
--- a/apps/codecs/speex.c
+++ b/apps/codecs/speex.c
@@ -369,9 +369,9 @@ static void *process_header(spx_ogg_packet *op,
369 *nframes = header->frames_per_packet; 369 *nframes = header->frames_per_packet;
370 370
371 if (*channels == 2) { 371 if (*channels == 2) {
372 rb->configure(DSP_SET_STEREO_MODE, (int *)STEREO_INTERLEAVED); 372 rb->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
373 } else if (*channels == 1) { 373 } else if (*channels == 1) {
374 rb->configure(DSP_SET_STEREO_MODE, (int *)STEREO_MONO); 374 rb->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
375 } 375 }
376 376
377 *extra_headers = header->extra_headers; 377 *extra_headers = header->extra_headers;
@@ -409,9 +409,9 @@ enum codec_status codec_main(void)
409 int j; 409 int j;
410 rb = ci; 410 rb = ci;
411 411
412 //rb->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (long *)(CHUNKSIZE*128)); 412 //rb->configure(CODEC_SET_FILEBUF_CHUNKSIZE, CHUNKSIZE*128);
413 //rb->configure(DSP_DITHER, (bool *)false); 413 //rb->configure(DSP_DITHER, false);
414 rb->configure(DSP_SET_SAMPLE_DEPTH, (long *)16); 414 rb->configure(DSP_SET_SAMPLE_DEPTH, 16);
415 415
416 /* We need to flush reserver memory every track load. */ 416 /* We need to flush reserver memory every track load. */
417next_track: 417next_track:
@@ -501,7 +501,7 @@ next_page:
501 501
502 rb->id3->vbr = true; 502 rb->id3->vbr = true;
503 rb->id3->frequency = samplerate; 503 rb->id3->frequency = samplerate;
504 rb->configure(DSP_SET_FREQUENCY, (int *)(rb->id3->frequency)); 504 rb->configure(DSP_SET_FREQUENCY, rb->id3->frequency);
505 505
506 /* Speex header in its own page, add the whole page 506 /* Speex header in its own page, add the whole page
507 headersize */ 507 headersize */
diff --git a/apps/codecs/vorbis.c b/apps/codecs/vorbis.c
index 8ab4a95faa..5f08fb5eeb 100644
--- a/apps/codecs/vorbis.c
+++ b/apps/codecs/vorbis.c
@@ -83,13 +83,13 @@ bool vorbis_set_codec_parameters(OggVorbis_File *vf)
83 return false; 83 return false;
84 } 84 }
85 85
86 ci->configure(DSP_SWITCH_FREQUENCY, (int *)ci->id3->frequency); 86 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
87 codec_set_replaygain(ci->id3); 87 codec_set_replaygain(ci->id3);
88 88
89 if (vi->channels == 2) { 89 if (vi->channels == 2) {
90 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_NONINTERLEAVED); 90 ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED);
91 } else if (vi->channels == 1) { 91 } else if (vi->channels == 1) {
92 ci->configure(DSP_SET_STEREO_MODE, (int *)STEREO_MONO); 92 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
93 } 93 }
94 94
95 return true; 95 return true;
@@ -112,9 +112,9 @@ enum codec_status codec_main(void)
112 ogg_uint32_t vf_serialnos; 112 ogg_uint32_t vf_serialnos;
113 ogg_int64_t vf_pcmlengths[2]; 113 ogg_int64_t vf_pcmlengths[2];
114 114
115 ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)24); 115 ci->configure(DSP_SET_SAMPLE_DEPTH, 24);
116 ci->configure(DSP_SET_CLIP_MAX, (long *)((1 << 24) - 1)); 116 ci->configure(DSP_SET_CLIP_MAX, (1 << 24) - 1);
117 ci->configure(DSP_SET_CLIP_MIN, (long *)-((1 << 24) - 1)); 117 ci->configure(DSP_SET_CLIP_MIN, -((1 << 24) - 1));
118 /* Note: These are sane defaults for these values. Perhaps 118 /* Note: These are sane defaults for these values. Perhaps
119 * they should be set differently based on quality setting 119 * they should be set differently based on quality setting
120 */ 120 */
@@ -122,7 +122,7 @@ enum codec_status codec_main(void)
122 /* The chunk size below is magic. If set any lower, resume 122 /* The chunk size below is magic. If set any lower, resume
123 * doesn't work properly (ov_raw_seek() does the wrong thing). 123 * doesn't work properly (ov_raw_seek() does the wrong thing).
124 */ 124 */
125 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (long *)(1024*256)); 125 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
126 126
127/* We need to flush reserver memory every track load. */ 127/* We need to flush reserver memory every track load. */
128next_track: 128next_track:
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c
index ec268a3a2b..b4eaaefb64 100644
--- a/apps/codecs/wav.c
+++ b/apps/codecs/wav.c
@@ -225,9 +225,9 @@ enum codec_status codec_main(void)
225 225
226 226
227 /* Generic codec initialisation */ 227 /* Generic codec initialisation */
228 ci->configure(DSP_SET_SAMPLE_DEPTH, (long *)28); 228 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
229 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); 229 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
230 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*256)); 230 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*256);
231 231
232next_track: 232next_track:
233 if (codec_init()) { 233 if (codec_init()) {
@@ -379,11 +379,11 @@ next_track:
379 goto done; 379 goto done;
380 } 380 }
381 381
382 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); 382 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
383 if (channels == 2) { 383 if (channels == 2) {
384 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_INTERLEAVED); 384 ci->configure(DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
385 } else if (channels == 1) { 385 } else if (channels == 1) {
386 ci->configure(DSP_SET_STEREO_MODE, (long *)STEREO_MONO); 386 ci->configure(DSP_SET_STEREO_MODE, STEREO_MONO);
387 } else { 387 } else {
388 DEBUGF("CODEC_ERROR: more than 2 channels\n"); 388 DEBUGF("CODEC_ERROR: more than 2 channels\n");
389 i = CODEC_ERROR; 389 i = CODEC_ERROR;
diff --git a/apps/codecs/wavpack.c b/apps/codecs/wavpack.c
index 34616d75e9..680673fec7 100644
--- a/apps/codecs/wavpack.c
+++ b/apps/codecs/wavpack.c
@@ -42,10 +42,10 @@ enum codec_status codec_main(void)
42 int retval; 42 int retval;
43 43
44 /* Generic codec initialisation */ 44 /* Generic codec initialisation */
45 ci->configure(CODEC_SET_FILEBUF_WATERMARK, (int *)(1024*512)); 45 ci->configure(CODEC_SET_FILEBUF_WATERMARK, 1024*512);
46 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, (int *)(1024*128)); 46 ci->configure(CODEC_SET_FILEBUF_CHUNKSIZE, 1024*128);
47 47
48 ci->configure(DSP_SET_SAMPLE_DEPTH, (int *)(28)); 48 ci->configure(DSP_SET_SAMPLE_DEPTH, 28);
49 49
50 next_track: 50 next_track:
51 51
@@ -57,7 +57,7 @@ enum codec_status codec_main(void)
57 while (!*ci->taginfo_ready && !ci->stop_codec) 57 while (!*ci->taginfo_ready && !ci->stop_codec)
58 ci->sleep(1); 58 ci->sleep(1);
59 59
60 ci->configure(DSP_SWITCH_FREQUENCY, (long *)(ci->id3->frequency)); 60 ci->configure(DSP_SWITCH_FREQUENCY, ci->id3->frequency);
61 codec_set_replaygain(ci->id3); 61 codec_set_replaygain(ci->id3);
62 62
63 /* Create a decoder instance */ 63 /* Create a decoder instance */
@@ -70,7 +70,7 @@ enum codec_status codec_main(void)
70 70
71 bps = WavpackGetBytesPerSample (wpc); 71 bps = WavpackGetBytesPerSample (wpc);
72 nchans = WavpackGetReducedChannels (wpc); 72 nchans = WavpackGetReducedChannels (wpc);
73 ci->configure(DSP_SET_STEREO_MODE, nchans == 2 ? (int *)STEREO_INTERLEAVED : (int *)STEREO_MONO); 73 ci->configure(DSP_SET_STEREO_MODE, nchans == 2 ? STEREO_INTERLEAVED : STEREO_MONO);
74 sr_100 = ci->id3->frequency / 100; 74 sr_100 = ci->id3->frequency / 100;
75 75
76 ci->set_elapsed (0); 76 ci->set_elapsed (0);
diff --git a/apps/dsp.c b/apps/dsp.c
index f7eb48ed03..533342ecf1 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -128,7 +128,7 @@ void sound_set_pitch(int permille)
128{ 128{
129 pitch_ratio = permille; 129 pitch_ratio = permille;
130 130
131 dsp_configure(DSP_SWITCH_FREQUENCY, (int *)dsp->codec_frequency); 131 dsp_configure(DSP_SWITCH_FREQUENCY, dsp->codec_frequency);
132} 132}
133 133
134/* Convert at most count samples to the internal format, if needed. Returns 134/* Convert at most count samples to the internal format, if needed. Returns
@@ -844,7 +844,7 @@ int dsp_stereo_mode(void)
844 return dsp->stereo_mode; 844 return dsp->stereo_mode;
845} 845}
846 846
847bool dsp_configure(int setting, void *value) 847bool dsp_configure(int setting, intptr_t value)
848{ 848{
849 dsp = &dsp_conf[current_codec]; 849 dsp = &dsp_conf[current_codec];
850 850
@@ -855,7 +855,7 @@ bool dsp_configure(int setting, void *value)
855 sizeof(struct resample_data)); 855 sizeof(struct resample_data));
856 /* Fall through!!! */ 856 /* Fall through!!! */
857 case DSP_SWITCH_FREQUENCY: 857 case DSP_SWITCH_FREQUENCY:
858 dsp->codec_frequency = ((long) value == 0) ? NATIVE_FREQUENCY : (long) value; 858 dsp->codec_frequency = (value == 0) ? NATIVE_FREQUENCY : value;
859 /* Account for playback speed adjustment when setting dsp->frequency 859 /* Account for playback speed adjustment when setting dsp->frequency
860 if we're called from the main audio thread. Voice UI thread should 860 if we're called from the main audio thread. Voice UI thread should
861 not need this feature. 861 not need this feature.
@@ -868,15 +868,15 @@ bool dsp_configure(int setting, void *value)
868 break; 868 break;
869 869
870 case DSP_SET_CLIP_MIN: 870 case DSP_SET_CLIP_MIN:
871 dsp->clip_min = (long) value; 871 dsp->clip_min = value;
872 break; 872 break;
873 873
874 case DSP_SET_CLIP_MAX: 874 case DSP_SET_CLIP_MAX:
875 dsp->clip_max = (long) value; 875 dsp->clip_max = value;
876 break; 876 break;
877 877
878 case DSP_SET_SAMPLE_DEPTH: 878 case DSP_SET_SAMPLE_DEPTH:
879 dsp->sample_depth = (long) value; 879 dsp->sample_depth = value;
880 880
881 if (dsp->sample_depth <= NATIVE_DEPTH) 881 if (dsp->sample_depth <= NATIVE_DEPTH)
882 { 882 {
@@ -887,10 +887,10 @@ bool dsp_configure(int setting, void *value)
887 } 887 }
888 else 888 else
889 { 889 {
890 dsp->frac_bits = (long) value; 890 dsp->frac_bits = value;
891 dsp->sample_bytes = 4; /* samples are 32 bits */ 891 dsp->sample_bytes = 4; /* samples are 32 bits */
892 dsp->clip_max = (1 << (long)value) - 1; 892 dsp->clip_max = (1 << value) - 1;
893 dsp->clip_min = -(1 << (long)value); 893 dsp->clip_min = -(1 << value);
894 } 894 }
895 895
896 dither_init(); 896 dither_init();
diff --git a/apps/dsp.h b/apps/dsp.h
index 5217224797..2f676d22bc 100644
--- a/apps/dsp.h
+++ b/apps/dsp.h
@@ -210,7 +210,7 @@ int dsp_process(char *dest, const char *src[], int count);
210int dsp_input_count(int count); 210int dsp_input_count(int count);
211int dsp_output_count(int count); 211int dsp_output_count(int count);
212int dsp_stereo_mode(void); 212int dsp_stereo_mode(void);
213bool dsp_configure(int setting, void *value); 213bool dsp_configure(int setting, intptr_t value);
214void dsp_set_replaygain(bool always); 214void dsp_set_replaygain(bool always);
215void dsp_set_crossfeed(bool enable); 215void dsp_set_crossfeed(bool enable);
216void dsp_set_crossfeed_direct_gain(int gain); 216void dsp_set_crossfeed_direct_gain(int gain);
diff --git a/apps/playback.c b/apps/playback.c
index f4287310b7..d256f5a4f0 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1663,7 +1663,7 @@ static void codec_seek_complete_callback(void)
1663 { 1663 {
1664 /* If this is not a seamless seek, clear the buffer */ 1664 /* If this is not a seamless seek, clear the buffer */
1665 pcmbuf_play_stop(); 1665 pcmbuf_play_stop();
1666 dsp_configure(DSP_FLUSH, NULL); 1666 dsp_configure(DSP_FLUSH, 0);
1667 1667
1668 /* If playback was not 'deliberately' paused, unpause now */ 1668 /* If playback was not 'deliberately' paused, unpause now */
1669 if (!paused) 1669 if (!paused)
@@ -1729,20 +1729,20 @@ static bool codec_seek_buffer_callback(size_t newpos)
1729 return true; 1729 return true;
1730} 1730}
1731 1731
1732static void codec_configure_callback(int setting, void *value) 1732static void codec_configure_callback(int setting, intptr_t value)
1733{ 1733{
1734 switch (setting) { 1734 switch (setting) {
1735 case CODEC_SET_FILEBUF_WATERMARK: 1735 case CODEC_SET_FILEBUF_WATERMARK:
1736 conf_watermark = (unsigned long)value; 1736 conf_watermark = value;
1737 set_filebuf_watermark(buffer_margin); 1737 set_filebuf_watermark(buffer_margin);
1738 break; 1738 break;
1739 1739
1740 case CODEC_SET_FILEBUF_CHUNKSIZE: 1740 case CODEC_SET_FILEBUF_CHUNKSIZE:
1741 conf_filechunk = (unsigned long)value; 1741 conf_filechunk = value;
1742 break; 1742 break;
1743 1743
1744 case CODEC_SET_FILEBUF_PRESEEK: 1744 case CODEC_SET_FILEBUF_PRESEEK:
1745 conf_preseek = (unsigned long)value; 1745 conf_preseek = value;
1746 break; 1746 break;
1747 1747
1748 default: 1748 default: