diff options
| author | Magnus Holmgren <magnushol@gmail.com> | 2010-05-08 13:21:27 +0000 |
|---|---|---|
| committer | Magnus Holmgren <magnushol@gmail.com> | 2010-05-08 13:21:27 +0000 |
| commit | fe29ad2edd58d674d6924a6d3dc412e30e7ab41c (patch) | |
| tree | 66ba4cf36cddb004f1549b317b81892cf3dab692 /apps | |
| parent | 35808b70d5b466e975967727fb501e9d0db40194 (diff) | |
| download | rockbox-fe29ad2edd58d674d6924a6d3dc412e30e7ab41c.zip rockbox-fe29ad2edd58d674d6924a6d3dc412e30e7ab41c.tar.gz rockbox-fe29ad2edd58d674d6924a6d3dc412e30e7ab41c.tar.bz2 rockbox-fe29ad2edd58d674d6924a6d3dc412e30e7ab41c.tar.xz | |
Save some binsize.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25899 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/metadata/wave.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/apps/metadata/wave.c b/apps/metadata/wave.c index cbf628a..564d028 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; } |