summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c12
-rw-r--r--apps/main_menu.c2
-rw-r--r--apps/playlist.c10
-rw-r--r--apps/plugin.c8
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/plugins/battery_test.c2
-rw-r--r--apps/plugins/jpeg.c2
-rw-r--r--apps/plugins/lib/xxx2wav.c14
-rw-r--r--apps/plugins/rockboy.c9
-rw-r--r--apps/plugins/rockboy/rockboy.c34
-rw-r--r--apps/plugins/sort.c2
-rw-r--r--apps/plugins/vbrfix.c26
-rw-r--r--apps/plugins/video.c2
-rw-r--r--apps/talk.c20
14 files changed, 74 insertions, 73 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index d8ebe9bfb1..2ab2194199 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -126,7 +126,7 @@ int load_wave(char *filename)
126 if (audio_size > 8*1024*1024) 126 if (audio_size > 8*1024*1024)
127 audio_size = 8*1024*1024; 127 audio_size = 8*1024*1024;
128 128
129 audio_buffer = mp3buf; 129 audio_buffer = audiobuf;
130 130
131 puts("Reading %d bytes..", audio_size); 131 puts("Reading %d bytes..", audio_size);
132 132
@@ -356,11 +356,11 @@ bool dbg_audio_thread(void)
356 356
357 lcd_clear_display(); 357 lcd_clear_display();
358 358
359 snprintf(buf, sizeof(buf), "read: %x", d.mp3buf_read); 359 snprintf(buf, sizeof(buf), "read: %x", d.audiobuf_read);
360 lcd_puts(0, 0, buf); 360 lcd_puts(0, 0, buf);
361 snprintf(buf, sizeof(buf), "write: %x", d.mp3buf_write); 361 snprintf(buf, sizeof(buf), "write: %x", d.audiobuf_write);
362 lcd_puts(0, 1, buf); 362 lcd_puts(0, 1, buf);
363 snprintf(buf, sizeof(buf), "swap: %x", d.mp3buf_swapwrite); 363 snprintf(buf, sizeof(buf), "swap: %x", d.audiobuf_swapwrite);
364 lcd_puts(0, 2, buf); 364 lcd_puts(0, 2, buf);
365 snprintf(buf, sizeof(buf), "playing: %d", d.playing); 365 snprintf(buf, sizeof(buf), "playing: %d", d.playing);
366 lcd_puts(0, 3, buf); 366 lcd_puts(0, 3, buf);
@@ -370,11 +370,11 @@ bool dbg_audio_thread(void)
370 lcd_puts(0, 5, buf); 370 lcd_puts(0, 5, buf);
371 371
372 /* Playable space left */ 372 /* Playable space left */
373 scrollbar(0, 6*8, 112, 4, d.mp3buflen, 0, 373 scrollbar(0, 6*8, 112, 4, d.audiobuflen, 0,
374 d.playable_space, HORIZONTAL); 374 d.playable_space, HORIZONTAL);
375 375
376 /* Show the watermark limit */ 376 /* Show the watermark limit */
377 scrollbar(0, 6*8+4, 112, 4, d.mp3buflen, 0, 377 scrollbar(0, 6*8+4, 112, 4, d.audiobuflen, 0,
378 d.low_watermark_level, HORIZONTAL); 378 d.low_watermark_level, HORIZONTAL);
379 379
380 snprintf(buf, sizeof(buf), "wm: %x - %x", 380 snprintf(buf, sizeof(buf), "wm: %x - %x",
diff --git a/apps/main_menu.c b/apps/main_menu.c
index c7cfb0ea70..055a83bc24 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -138,7 +138,7 @@ extern bool simulate_usb(void);
138bool show_info(void) 138bool show_info(void)
139{ 139{
140 char s[32], s2[32]; 140 char s[32], s2[32];
141 long buflen = ((mp3end - mp3buf) * 2) / 2097; /* avoid overflow */ 141 long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
142 int integer, decimal; 142 int integer, decimal;
143 bool done = false; 143 bool done = false;
144 int key; 144 int key;
diff --git a/apps/playlist.c b/apps/playlist.c
index 3370937a69..8c9d6d11c7 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -351,8 +351,8 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
351 audio_stop(); 351 audio_stop();
352 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ 352 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
353 353
354 buffer = mp3buf; 354 buffer = audiobuf;
355 buflen = (mp3end - mp3buf); 355 buflen = (audiobufend - audiobuf);
356 } 356 }
357 357
358 store_index = true; 358 store_index = true;
@@ -1211,8 +1211,8 @@ int playlist_resume(void)
1211 1211
1212 /* use mp3 buffer for maximum load speed */ 1212 /* use mp3 buffer for maximum load speed */
1213 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ 1213 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
1214 buflen = (mp3end - mp3buf); 1214 buflen = (audiobufend - audiobuf);
1215 buffer = mp3buf; 1215 buffer = audiobuf;
1216 1216
1217 empty_playlist(playlist, true); 1217 empty_playlist(playlist, true);
1218 1218
@@ -1294,7 +1294,7 @@ int playlist_resume(void)
1294 if (str3[0] != '\0') 1294 if (str3[0] != '\0')
1295 { 1295 {
1296 /* NOTE: add_indices_to_playlist() overwrites the 1296 /* NOTE: add_indices_to_playlist() overwrites the
1297 mp3buf so we need to reload control file 1297 audiobuf so we need to reload control file
1298 data */ 1298 data */
1299 add_indices_to_playlist(playlist, NULL, 0); 1299 add_indices_to_playlist(playlist, NULL, 0);
1300 } 1300 }
diff --git a/apps/plugin.c b/apps/plugin.c
index 412d86b4c9..7a9875ac2c 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -238,7 +238,7 @@ static const struct plugin_api rockbox_api = {
238 get_time, 238 get_time,
239 set_time, 239 set_time,
240 plugin_get_buffer, 240 plugin_get_buffer,
241 plugin_get_mp3_buffer, 241 plugin_get_audio_buffer,
242#ifndef SIMULATOR 242#ifndef SIMULATOR
243 plugin_register_timer, 243 plugin_register_timer,
244 plugin_unregister_timer, 244 plugin_unregister_timer,
@@ -407,12 +407,12 @@ void* plugin_get_buffer(int* buffer_size)
407 407
408/* Returns a pointer to the mp3 buffer. 408/* Returns a pointer to the mp3 buffer.
409 Playback gets stopped, to avoid conflicts. */ 409 Playback gets stopped, to avoid conflicts. */
410void* plugin_get_mp3_buffer(int* buffer_size) 410void* plugin_get_audio_buffer(int* buffer_size)
411{ 411{
412 audio_stop(); 412 audio_stop();
413 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ 413 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
414 *buffer_size = mp3end - mp3buf; 414 *buffer_size = audiobufend - audiobuf;
415 return mp3buf; 415 return audiobuf;
416} 416}
417 417
418#ifndef SIMULATOR 418#ifndef SIMULATOR
diff --git a/apps/plugin.h b/apps/plugin.h
index ff37a7c46d..9fd9a9421c 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -280,7 +280,7 @@ struct plugin_api {
280 struct tm* (*get_time)(void); 280 struct tm* (*get_time)(void);
281 int (*set_time)(const struct tm *tm); 281 int (*set_time)(const struct tm *tm);
282 void* (*plugin_get_buffer)(int* buffer_size); 282 void* (*plugin_get_buffer)(int* buffer_size);
283 void* (*plugin_get_mp3_buffer)(int* buffer_size); 283 void* (*plugin_get_audio_buffer)(int* buffer_size);
284#ifndef SIMULATOR 284#ifndef SIMULATOR
285 int (*plugin_register_timer)(int cycles, int prio, void (*timer_callback)(void)); 285 int (*plugin_register_timer)(int cycles, int prio, void (*timer_callback)(void));
286 void (*plugin_unregister_timer)(void); 286 void (*plugin_unregister_timer)(void);
@@ -334,7 +334,7 @@ struct plugin_api {
334/* defined by the plugin loader (plugin.c) */ 334/* defined by the plugin loader (plugin.c) */
335int plugin_load(const char* plugin, void* parameter); 335int plugin_load(const char* plugin, void* parameter);
336void* plugin_get_buffer(int *buffer_size); 336void* plugin_get_buffer(int *buffer_size);
337void* plugin_get_mp3_buffer(int *buffer_size); 337void* plugin_get_audio_buffer(int *buffer_size);
338int plugin_register_timer(int cycles, int prio, void (*timer_callback)(void)); 338int plugin_register_timer(int cycles, int prio, void (*timer_callback)(void));
339void plugin_unregister_timer(void); 339void plugin_unregister_timer(void);
340void plugin_tsr(void (*exit_callback)(void)); 340void plugin_tsr(void (*exit_callback)(void));
diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c
index 73affddf8b..47042e6cf0 100644
--- a/apps/plugins/battery_test.c
+++ b/apps/plugins/battery_test.c
@@ -48,7 +48,7 @@ int buffersize;
48int init(void) 48int init(void)
49{ 49{
50 int f; 50 int f;
51 buffer = rb->plugin_get_mp3_buffer(&buffersize); 51 buffer = rb->plugin_get_audio_buffer(&buffersize);
52 52
53#ifdef HAVE_MMC 53#ifdef HAVE_MMC
54 /* present info what's going on. MMC is slow. */ 54 /* present info what's going on. MMC is slow. */
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index f705271240..7ca59b29cd 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -1824,7 +1824,7 @@ int main(char* filename)
1824 1824
1825 rb->memset(&disp, 0, sizeof(disp)); 1825 rb->memset(&disp, 0, sizeof(disp));
1826 1826
1827 buf = rb->plugin_get_mp3_buffer(&buf_size); /* start munching memory */ 1827 buf = rb->plugin_get_audio_buffer(&buf_size); /* start munching memory */
1828 1828
1829 1829
1830 /* initialize the grayscale buffer: 1830 /* initialize the grayscale buffer:
diff --git a/apps/plugins/lib/xxx2wav.c b/apps/plugins/lib/xxx2wav.c
index 4d0c139f1b..d864527fc2 100644
--- a/apps/plugins/lib/xxx2wav.c
+++ b/apps/plugins/lib/xxx2wav.c
@@ -29,9 +29,9 @@ static struct plugin_api* local_rb;
29 29
30int mem_ptr; 30int mem_ptr;
31int bufsize; 31int bufsize;
32unsigned char* mp3buf; // The actual MP3 buffer from Rockbox 32unsigned char* audiobuf; // The actual audio buffer from Rockbox
33unsigned char* mallocbuf; // 512K from the start of MP3 buffer 33unsigned char* mallocbuf; // 512K from the start of audio buffer
34unsigned char* filebuf; // The rest of the MP3 buffer 34unsigned char* filebuf; // The rest of the audio buffer
35 35
36void* codec_malloc(size_t size) { 36void* codec_malloc(size_t size) {
37 void* x; 37 void* x;
@@ -169,11 +169,11 @@ int local_init(char* infilename, char* outfilename, file_info_struct* file_info,
169 local_rb=rb; 169 local_rb=rb;
170 170
171 mem_ptr=0; 171 mem_ptr=0;
172 mp3buf=local_rb->plugin_get_mp3_buffer(&bufsize); 172 audiobuf=local_rb->plugin_get_audio_buffer(&bufsize);
173 mallocbuf=mp3buf; 173 mallocbuf=audiobuf;
174 filebuf=&mp3buf[MALLOC_BUFSIZE]; 174 filebuf=&audiobuf[MALLOC_BUFSIZE];
175 175
176 local_rb->snprintf(s,32,"mp3 bufsize: %d",bufsize); 176 local_rb->snprintf(s,32,"audio bufsize: %d",bufsize);
177 local_rb->lcd_putsxy(0,100,s); 177 local_rb->lcd_putsxy(0,100,s);
178 local_rb->lcd_update(); 178 local_rb->lcd_update();
179 179
diff --git a/apps/plugins/rockboy.c b/apps/plugins/rockboy.c
index 4778fa8ee6..d531c9405b 100644
--- a/apps/plugins/rockboy.c
+++ b/apps/plugins/rockboy.c
@@ -26,8 +26,8 @@
26#define OVL_DISPLAYNAME "RockBoy" 26#define OVL_DISPLAYNAME "RockBoy"
27 27
28struct plugin_api* rb; 28struct plugin_api* rb;
29unsigned char *mp3buf; 29unsigned char *audiobuf;
30int mp3buf_size; 30int audiobuf_size;
31 31
32/* this is the plugin entry point */ 32/* this is the plugin entry point */
33enum plugin_status plugin_start(struct plugin_api* api, void* parameter) 33enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
@@ -60,8 +60,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
60 return PLUGIN_ERROR; 60 return PLUGIN_ERROR;
61 } 61 }
62 62
63 mp3buf = rb->plugin_get_mp3_buffer(&mp3buf_size); 63 audiobuf = rb->plugin_get_audio_buffer(&audiobuf_size);
64 if (header.start_addr < mp3buf || header.end_addr > mp3buf + mp3buf_size) 64 if (header.start_addr < audiobuf ||
65 header.end_addr > audiobuf + audiobuf_size)
65 { 66 {
66 rb->close(fh); 67 rb->close(fh);
67 rb->splash(2*HZ, true, OVL_DISPLAYNAME 68 rb->splash(2*HZ, true, OVL_DISPLAYNAME
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index c6d006a131..1b4c0c7a7d 100644
--- a/apps/plugins/rockboy/rockboy.c
+++ b/apps/plugins/rockboy/rockboy.c
@@ -59,37 +59,37 @@ void die(char *message, ...)
59 errormsg=message; 59 errormsg=message;
60} 60}
61 61
62void *mp3_bufferbase; 62void *audio_bufferbase;
63void *mp3_bufferpointer; 63void *audio_bufferpointer;
64unsigned int mp3_buffer_free; 64unsigned int audio_buffer_free;
65 65
66void *my_malloc(size_t size) 66void *my_malloc(size_t size)
67{ 67{
68 void *alloc; 68 void *alloc;
69 69
70 if (!mp3_bufferbase) 70 if (!audio_bufferbase)
71 { 71 {
72 mp3_bufferbase = mp3_bufferpointer 72 audio_bufferbase = audio_bufferpointer
73 = rb->plugin_get_mp3_buffer(&mp3_buffer_free); 73 = rb->plugin_get_audio_buffer(&audio_buffer_free);
74#if MEM <= 8 && !defined(SIMULATOR) 74#if MEM <= 8 && !defined(SIMULATOR)
75 /* loaded as an overlay, protect from overwriting ourselves */ 75 /* loaded as an overlay, protect from overwriting ourselves */
76 if ((unsigned)(ovl_start_addr - (unsigned char *)mp3_bufferbase) 76 if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase)
77 < mp3_buffer_free) 77 < audio_buffer_free)
78 mp3_buffer_free = ovl_start_addr - (unsigned char *)mp3_bufferbase; 78 audio_buffer_free = ovl_start_addr - (unsigned char *)audio_bufferbase;
79#endif 79#endif
80 } 80 }
81 if (size + 4 > mp3_buffer_free) 81 if (size + 4 > audio_buffer_free)
82 return 0; 82 return 0;
83 alloc = mp3_bufferpointer; 83 alloc = audio_bufferpointer;
84 mp3_bufferpointer += size + 4; 84 audio_bufferpointer += size + 4;
85 mp3_buffer_free -= size + 4; 85 audio_buffer_free -= size + 4;
86 return alloc; 86 return alloc;
87} 87}
88 88
89void setmallocpos(void *pointer) 89void setmallocpos(void *pointer)
90{ 90{
91 mp3_bufferpointer = pointer; 91 audio_bufferpointer = pointer;
92 mp3_buffer_free = mp3_bufferpointer - mp3_bufferbase; 92 audio_buffer_free = audio_bufferpointer - audio_bufferbase;
93} 93}
94 94
95/* this is the plugin entry point */ 95/* this is the plugin entry point */
@@ -113,8 +113,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
113#endif 113#endif
114 shut=0; 114 shut=0;
115 cleanshut=0; 115 cleanshut=0;
116 mp3_bufferbase=mp3_bufferpointer=0; 116 audio_bufferbase=audio_bufferpointer=0;
117 mp3_buffer_free=0; 117 audio_buffer_free=0;
118 118
119 /* now go ahead and have fun! */ 119 /* now go ahead and have fun! */
120 /* rb->splash(HZ*2, true, "Rockboy v0.3"); */ 120 /* rb->splash(HZ*2, true, "Rockboy v0.3"); */
diff --git a/apps/plugins/sort.c b/apps/plugins/sort.c
index b17f5a441a..cf91dbb4dd 100644
--- a/apps/plugins/sort.c
+++ b/apps/plugins/sort.c
@@ -184,7 +184,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
184 184
185 rb = api; 185 rb = api;
186 186
187 buf = rb->plugin_get_mp3_buffer(&buf_size); /* start munching memory */ 187 buf = rb->plugin_get_audio_buffer(&buf_size); /* start munching memory */
188 188
189 stringbuffer = buf; 189 stringbuffer = buf;
190 pointers = (char **)(buf + buf_size - sizeof(int)); 190 pointers = (char **)(buf + buf_size - sizeof(int));
diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c
index 0077340ec9..7fb072c656 100644
--- a/apps/plugins/vbrfix.c
+++ b/apps/plugins/vbrfix.c
@@ -20,8 +20,8 @@
20 20
21static struct plugin_api* rb; 21static struct plugin_api* rb;
22 22
23static char *mp3buf; 23static char *audiobuf;
24static int mp3buflen; 24static int audiobuflen;
25 25
26static void xingupdate(int percent) 26static void xingupdate(int percent)
27{ 27{
@@ -56,14 +56,14 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes)
56 56
57 /* First, copy the initial portion (the ID3 tag) */ 57 /* First, copy the initial portion (the ID3 tag) */
58 if(fpos) { 58 if(fpos) {
59 readlen = rb->read(orig_fd, mp3buf, fpos); 59 readlen = rb->read(orig_fd, audiobuf, fpos);
60 if(readlen < 0) { 60 if(readlen < 0) {
61 rb->close(fd); 61 rb->close(fd);
62 rb->close(orig_fd); 62 rb->close(orig_fd);
63 return 10*readlen - 3; 63 return 10*readlen - 3;
64 } 64 }
65 65
66 rc = rb->write(fd, mp3buf, readlen); 66 rc = rb->write(fd, audiobuf, readlen);
67 if(rc < 0) { 67 if(rc < 0) {
68 rb->close(fd); 68 rb->close(fd);
69 rb->close(orig_fd); 69 rb->close(orig_fd);
@@ -81,14 +81,14 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes)
81 81
82 /* Copy the file */ 82 /* Copy the file */
83 do { 83 do {
84 readlen = rb->read(orig_fd, mp3buf, mp3buflen); 84 readlen = rb->read(orig_fd, audiobuf, audiobuflen);
85 if(readlen < 0) { 85 if(readlen < 0) {
86 rb->close(fd); 86 rb->close(fd);
87 rb->close(orig_fd); 87 rb->close(orig_fd);
88 return 10*readlen - 7; 88 return 10*readlen - 7;
89 } 89 }
90 90
91 rc = rb->write(fd, mp3buf, readlen); 91 rc = rb->write(fd, audiobuf, readlen);
92 if(rc < 0) { 92 if(rc < 0) {
93 rb->close(fd); 93 rb->close(fd);
94 rb->close(orig_fd); 94 rb->close(orig_fd);
@@ -193,8 +193,8 @@ static bool vbr_fix(char *selected_file)
193 and write it to the file */ 193 and write it to the file */
194 if(unused_space) 194 if(unused_space)
195 { 195 {
196 rb->memset(mp3buf, 0, unused_space); 196 rb->memset(audiobuf, 0, unused_space);
197 rc = rb->write(fd, mp3buf, unused_space); 197 rc = rb->write(fd, audiobuf, unused_space);
198 if(rc < 0) { 198 if(rc < 0) {
199 rb->close(fd); 199 rb->close(fd);
200 fileerror(rc); 200 fileerror(rc);
@@ -230,20 +230,20 @@ static bool vbr_fix(char *selected_file)
230 DEBUGF("Inserting 4096+%d bytes\n", framelen); 230 DEBUGF("Inserting 4096+%d bytes\n", framelen);
231 numbytes = 4096 + framelen; 231 numbytes = 4096 + framelen;
232 232
233 rb->memset(mp3buf + 0x100000, 0, numbytes); 233 rb->memset(audiobuf + 0x100000, 0, numbytes);
234 234
235 /* Insert the ID3 header */ 235 /* Insert the ID3 header */
236 rb->memcpy(mp3buf + 0x100000, empty_id3_header, 236 rb->memcpy(audiobuf + 0x100000, empty_id3_header,
237 sizeof(empty_id3_header)); 237 sizeof(empty_id3_header));
238 } 238 }
239 239
240 /* Copy the Xing header */ 240 /* Copy the Xing header */
241 rb->memcpy(mp3buf + 0x100000 + numbytes - framelen, 241 rb->memcpy(audiobuf + 0x100000 + numbytes - framelen,
242 xingbuf, framelen); 242 xingbuf, framelen);
243 243
244 rc = insert_data_in_file(selected_file, 244 rc = insert_data_in_file(selected_file,
245 entry.first_frame_offset, 245 entry.first_frame_offset,
246 mp3buf + 0x100000, numbytes); 246 audiobuf + 0x100000, numbytes);
247 247
248 if(rc < 0) { 248 if(rc < 0) {
249 fileerror(rc); 249 fileerror(rc);
@@ -272,7 +272,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void *parameter)
272 if (!parameter) 272 if (!parameter)
273 return PLUGIN_ERROR; 273 return PLUGIN_ERROR;
274 274
275 mp3buf = rb->plugin_get_mp3_buffer(&mp3buflen); 275 audiobuf = rb->plugin_get_audio_buffer(&audiobuflen);
276 276
277 vbr_fix(parameter); 277 vbr_fix(parameter);
278 278
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
index 0257ad26b7..db371392d5 100644
--- a/apps/plugins/video.c
+++ b/apps/plugins/video.c
@@ -864,7 +864,7 @@ int main(char* filename)
864 // init buffer 864 // init buffer
865 rb->memset(&gBuf, 0, sizeof(gBuf)); 865 rb->memset(&gBuf, 0, sizeof(gBuf));
866 gBuf.pOSD = rb->lcd_framebuffer + LCD_WIDTH*7; // last screen line 866 gBuf.pOSD = rb->lcd_framebuffer + LCD_WIDTH*7; // last screen line
867 gBuf.pBufStart = rb->plugin_get_mp3_buffer(&gBuf.bufsize); 867 gBuf.pBufStart = rb->plugin_get_audio_buffer(&gBuf.bufsize);
868 //gBuf.bufsize = 1700*1024; // test, like 2MB version!!!! 868 //gBuf.bufsize = 1700*1024; // test, like 2MB version!!!!
869 gBuf.pBufFill = gBuf.pBufStart; // all empty 869 gBuf.pBufFill = gBuf.pBufStart; // all empty
870 870
diff --git a/apps/talk.c b/apps/talk.c
index 2b97629d55..b6e2ec57a1 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -131,7 +131,7 @@ static void load_voicefile(void)
131 goto load_err; 131 goto load_err;
132 132
133 file_size = filesize(filehandle); 133 file_size = filesize(filehandle);
134 if (file_size > mp3end - mp3buf) /* won't fit? */ 134 if (file_size > audiobufend - audiobuf) /* won't fit? */
135 goto load_err; 135 goto load_err;
136 136
137#ifdef HAVE_MMC /* load only the header for now */ 137#ifdef HAVE_MMC /* load only the header for now */
@@ -140,17 +140,17 @@ static void load_voicefile(void)
140 load_size = file_size; 140 load_size = file_size;
141#endif 141#endif
142 142
143 got_size = read(filehandle, mp3buf, load_size); 143 got_size = read(filehandle, audiobuf, load_size);
144 if (got_size == load_size /* success */ 144 if (got_size == load_size /* success */
145 && ((struct voicefile*)mp3buf)->table /* format check */ 145 && ((struct voicefile*)audiobuf)->table /* format check */
146 == offsetof(struct voicefile, index)) 146 == offsetof(struct voicefile, index))
147 { 147 {
148 p_voicefile = (struct voicefile*)mp3buf; 148 p_voicefile = (struct voicefile*)audiobuf;
149 149
150 /* thumbnail buffer is the remaining space behind */ 150 /* thumbnail buffer is the remaining space behind */
151 p_thumbnail = mp3buf + file_size; 151 p_thumbnail = audiobuf + file_size;
152 p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */ 152 p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */
153 size_for_thumbnail = mp3end - p_thumbnail; 153 size_for_thumbnail = audiobufend - p_thumbnail;
154 } 154 }
155 else 155 else
156 goto load_err; 156 goto load_err;
@@ -160,7 +160,7 @@ static void load_voicefile(void)
160 load_size = (p_voicefile->id1_max + p_voicefile->id2_max) 160 load_size = (p_voicefile->id1_max + p_voicefile->id2_max)
161 * sizeof(struct clip_entry); 161 * sizeof(struct clip_entry);
162 got_size = read(filehandle, 162 got_size = read(filehandle,
163 mp3buf + offsetof(struct voicefile, index), load_size); 163 audiobuf + offsetof(struct voicefile, index), load_size);
164 if (got_size != load_size) /* read error */ 164 if (got_size != load_size) /* read error */
165 goto load_err; 165 goto load_err;
166#else 166#else
@@ -356,7 +356,7 @@ static unsigned char* get_clip(long id, long* p_size)
356 clipsize = p_voicefile->index[id].size; 356 clipsize = p_voicefile->index[id].size;
357 if (clipsize == 0) /* clip not included in voicefile */ 357 if (clipsize == 0) /* clip not included in voicefile */
358 return NULL; 358 return NULL;
359 clipbuf = mp3buf + p_voicefile->index[id].offset; 359 clipbuf = audiobuf + p_voicefile->index[id].offset;
360 360
361#ifdef HAVE_MMC /* dynamic loading, on demand */ 361#ifdef HAVE_MMC /* dynamic loading, on demand */
362 if (!(clipsize & LOADED_MASK)) 362 if (!(clipsize & LOADED_MASK))
@@ -383,8 +383,8 @@ static void reset_state(void)
383{ 383{
384 queue_write = queue_read = 0; /* reset the queue */ 384 queue_write = queue_read = 0; /* reset the queue */
385 p_voicefile = NULL; /* indicate no voicefile (trashed) */ 385 p_voicefile = NULL; /* indicate no voicefile (trashed) */
386 p_thumbnail = mp3buf; /* whole space for thumbnail */ 386 p_thumbnail = audiobuf; /* whole space for thumbnail */
387 size_for_thumbnail = mp3end - mp3buf; 387 size_for_thumbnail = audiobufend - audiobuf;
388 p_silence = NULL; /* pause clip not accessible */ 388 p_silence = NULL; /* pause clip not accessible */
389} 389}
390 390