From fe29ad2edd58d674d6924a6d3dc412e30e7ab41c Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sat, 8 May 2010 13:21:27 +0000 Subject: Save some binsize. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25899 a1c6a512-1295-4272-9138-f99709370657 --- apps/metadata/wave.c | 24 +++++++++++------------- 1 file 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 unsigned char *endp; unsigned char *data_pos; unsigned char *curpos = id3->id3v2buf; - unsigned char *nextpos; int datasize; int infosize; int remain = ID3V2_BUF_SIZE; + bool convert_string; if (is_64) lseek(fd, 4, SEEK_CUR); @@ -267,7 +267,7 @@ static bool parse_list_chunk(int fd, struct mp3entry* id3, int chunksize, bool i endp = bp + infosize; while (bp < endp) { - nextpos = curpos; + convert_string = true; datasize = get_long_le(bp + 4); data_pos = bp + 8; 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 if (memcmp(bp, infochunk_list[INFO_TITLE], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->title = curpos; } else if (memcmp(bp, infochunk_list[INFO_ARTIST], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->artist = curpos; } else if (memcmp(bp, infochunk_list[INFO_ALBUM_ARTIST], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->albumartist = curpos; } else if (memcmp(bp, infochunk_list[INFO_COMPOSER], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->composer = curpos; } else if (memcmp(bp, infochunk_list[INFO_COMMENT], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->comment = curpos; } else if (memcmp(bp, infochunk_list[INFO_GROUPING], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->grouping = curpos; } else if (memcmp(bp, infochunk_list[INFO_GENRE], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->genre_string = curpos; } else if (memcmp(bp, infochunk_list[INFO_DATE], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->year_string = curpos; } else if (memcmp(bp, infochunk_list[INFO_TRACK], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->track_string = curpos; } else if (memcmp(bp, infochunk_list[INFO_DISC], 4) == 0) { - nextpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); id3->disc_string = curpos; } + else + { + convert_string = false; + } + + if (convert_string) + { + curpos = convert_utf8(data_pos, curpos, datasize, remain, is_64); + } bp = data_pos + datasize + (datasize & 1); - curpos = nextpos; }; return true; } -- cgit v1.2.3