summaryrefslogtreecommitdiff
path: root/apps/talk.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/talk.c')
-rw-r--r--apps/talk.c20
1 files changed, 10 insertions, 10 deletions
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