summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2010-05-08 13:21:27 +0000
committerMagnus Holmgren <magnushol@gmail.com>2010-05-08 13:21:27 +0000
commitfe29ad2edd58d674d6924a6d3dc412e30e7ab41c (patch)
tree66ba4cf36cddb004f1549b317b81892cf3dab692
parent35808b70d5b466e975967727fb501e9d0db40194 (diff)
downloadrockbox-fe29ad2edd58d674d6924a6d3dc412e30e7ab41c.tar.gz
rockbox-fe29ad2edd58d674d6924a6d3dc412e30e7ab41c.zip
Save some binsize.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25899 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/metadata/wave.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/apps/metadata/wave.c b/apps/metadata/wave.c
index cbf628a599..564d028140 100644
--- a/apps/metadata/wave.c
+++ b/apps/metadata/wave.c
@@ -250,10 +250,10 @@ static bool parse_list_chunk(int fd, struct mp3entry* id3, int chunksize, bool i
250 unsigned char *endp; 250 unsigned char *endp;
251 unsigned char *data_pos; 251 unsigned char *data_pos;
252 unsigned char *curpos = id3->id3v2buf; 252 unsigned char *curpos = id3->id3v2buf;
253 unsigned char *nextpos;
254 int datasize; 253 int datasize;
255 int infosize; 254 int infosize;
256 int remain = ID3V2_BUF_SIZE; 255 int remain = ID3V2_BUF_SIZE;
256 bool convert_string;
257 257
258 if (is_64) 258 if (is_64)
259 lseek(fd, 4, SEEK_CUR); 259 lseek(fd, 4, SEEK_CUR);
@@ -267,7 +267,7 @@ static bool parse_list_chunk(int fd, struct mp3entry* id3, int chunksize, bool i
267 endp = bp + infosize; 267 endp = bp + infosize;
268 while (bp < endp) 268 while (bp < endp)
269 { 269 {
270 nextpos = curpos; 270 convert_string = true;
271 datasize = get_long_le(bp + 4); 271 datasize = get_long_le(bp + 4);
272 data_pos = bp + 8; 272 data_pos = bp + 8;
273 remain = ID3V2_BUF_SIZE - (curpos - (unsigned char*)id3->id3v2buf); 273 remain = ID3V2_BUF_SIZE - (curpos - (unsigned char*)id3->id3v2buf);
@@ -276,57 +276,55 @@ static bool parse_list_chunk(int fd, struct mp3entry* id3, int chunksize, bool i
276 276
277 if (memcmp(bp, infochunk_list[INFO_TITLE], 4) == 0) 277 if (memcmp(bp, infochunk_list[INFO_TITLE], 4) == 0)
278 { 278 {
279 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
280 id3->title = curpos; 279 id3->title = curpos;
281 } 280 }
282 else if (memcmp(bp, infochunk_list[INFO_ARTIST], 4) == 0) 281 else if (memcmp(bp, infochunk_list[INFO_ARTIST], 4) == 0)
283 { 282 {
284 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
285 id3->artist = curpos; 283 id3->artist = curpos;
286 } 284 }
287 else if (memcmp(bp, infochunk_list[INFO_ALBUM_ARTIST], 4) == 0) 285 else if (memcmp(bp, infochunk_list[INFO_ALBUM_ARTIST], 4) == 0)
288 { 286 {
289 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
290 id3->albumartist = curpos; 287 id3->albumartist = curpos;
291 } 288 }
292 else if (memcmp(bp, infochunk_list[INFO_COMPOSER], 4) == 0) 289 else if (memcmp(bp, infochunk_list[INFO_COMPOSER], 4) == 0)
293 { 290 {
294 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
295 id3->composer = curpos; 291 id3->composer = curpos;
296 } 292 }
297 else if (memcmp(bp, infochunk_list[INFO_COMMENT], 4) == 0) 293 else if (memcmp(bp, infochunk_list[INFO_COMMENT], 4) == 0)
298 { 294 {
299 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
300 id3->comment = curpos; 295 id3->comment = curpos;
301 } 296 }
302 else if (memcmp(bp, infochunk_list[INFO_GROUPING], 4) == 0) 297 else if (memcmp(bp, infochunk_list[INFO_GROUPING], 4) == 0)
303 { 298 {
304 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
305 id3->grouping = curpos; 299 id3->grouping = curpos;
306 } 300 }
307 else if (memcmp(bp, infochunk_list[INFO_GENRE], 4) == 0) 301 else if (memcmp(bp, infochunk_list[INFO_GENRE], 4) == 0)
308 { 302 {
309 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
310 id3->genre_string = curpos; 303 id3->genre_string = curpos;
311 } 304 }
312 else if (memcmp(bp, infochunk_list[INFO_DATE], 4) == 0) 305 else if (memcmp(bp, infochunk_list[INFO_DATE], 4) == 0)
313 { 306 {
314 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
315 id3->year_string = curpos; 307 id3->year_string = curpos;
316 } 308 }
317 else if (memcmp(bp, infochunk_list[INFO_TRACK], 4) == 0) 309 else if (memcmp(bp, infochunk_list[INFO_TRACK], 4) == 0)
318 { 310 {
319 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
320 id3->track_string = curpos; 311 id3->track_string = curpos;
321 } 312 }
322 else if (memcmp(bp, infochunk_list[INFO_DISC], 4) == 0) 313 else if (memcmp(bp, infochunk_list[INFO_DISC], 4) == 0)
323 { 314 {
324 nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
325 id3->disc_string = curpos; 315 id3->disc_string = curpos;
326 } 316 }
317 else
318 {
319 convert_string = false;
320 }
321
322 if (convert_string)
323 {
324 curpos = convert_utf8(data_pos, curpos, datasize, remain, is_64);
325 }
327 326
328 bp = data_pos + datasize + (datasize & 1); 327 bp = data_pos + datasize + (datasize & 1);
329 curpos = nextpos;
330 }; 328 };
331 return true; 329 return true;
332} 330}