summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2010-05-09 19:58:20 +0000
committerJeffrey Goode <jeffg7@gmail.com>2010-05-09 19:58:20 +0000
commita26a68d23c6376d75d9f073adee0c46e959fa2a8 (patch)
treed65088e3ba19ba04b353d0f7ed2355f877fe0872
parent70daf4ed4df7753cec5ce809265652bbaf18710c (diff)
downloadrockbox-a26a68d23c6376d75d9f073adee0c46e959fa2a8.tar.gz
rockbox-a26a68d23c6376d75d9f073adee0c46e959fa2a8.zip
Fix wav metadata bug, also fix typos and some const police
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25919 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/metadata/wave.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/metadata/wave.c b/apps/metadata/wave.c
index e34c740aa5..42203e9524 100644
--- a/apps/metadata/wave.c
+++ b/apps/metadata/wave.c
@@ -251,6 +251,8 @@ static void parse_list_chunk(int fd, struct mp3entry* id3, int chunksize, bool i
251 lseek(fd, 4, SEEK_CUR); 251 lseek(fd, 4, SEEK_CUR);
252 else if (read(fd, bp, 4) < 4 || memcmp(bp, "INFO", 4)) 252 else if (read(fd, bp, 4) < 4 || memcmp(bp, "INFO", 4))
253 return; 253 return;
254 else
255 chunksize -= 4; /* don't include "INFO" tag in chunksize */
254 256
255 infosize = read(fd, bp, (ID3V2_BUF_SIZE > chunksize)? chunksize : ID3V2_BUF_SIZE); 257 infosize = read(fd, bp, (ID3V2_BUF_SIZE > chunksize)? chunksize : ID3V2_BUF_SIZE);
256 if (infosize <= 8) 258 if (infosize <= 8)
@@ -289,9 +291,9 @@ static bool read_header(int fd, struct mp3entry* id3, const unsigned char *chunk
289 291
290 struct wave_fmt fmt; 292 struct wave_fmt fmt;
291 293
292 unsigned int namelen = (is_64)? WAVE64_CHUNKNAME_LENGTH : WAVE_CHUNKNAME_LENGTH; 294 const unsigned int namelen = (is_64)? WAVE64_CHUNKNAME_LENGTH : WAVE_CHUNKNAME_LENGTH;
293 unsigned int sizelen = (is_64)? WAVE64_CHUNKSIZE_LENGTH : WAVE_CHUNKSIZE_LENGTH; 295 const unsigned int sizelen = (is_64)? WAVE64_CHUNKSIZE_LENGTH : WAVE_CHUNKSIZE_LENGTH;
294 unsigned int len = namelen + sizelen; 296 const unsigned int len = namelen + sizelen;
295 uint64_t chunksize; 297 uint64_t chunksize;
296 uint64_t offset = len + namelen; 298 uint64_t offset = len + namelen;
297 int read_data; 299 int read_data;
@@ -403,9 +405,9 @@ static bool read_header(int fd, struct mp3entry* id3, const unsigned char *chunk
403 DEBUGF(" bitspersample: %u\n", fmt.bitspersample); 405 DEBUGF(" bitspersample: %u\n", fmt.bitspersample);
404 DEBUGF(" samplesperblock: %u\n", fmt.samplesperblock); 406 DEBUGF(" samplesperblock: %u\n", fmt.samplesperblock);
405 DEBUGF(" totalsamples: %u\n", (unsigned int)fmt.totalsamples); 407 DEBUGF(" totalsamples: %u\n", (unsigned int)fmt.totalsamples);
406 DEBUGF(" numbytes; %u\n", (unsigned int)fmt.numbytes); 408 DEBUGF(" numbytes: %u\n", (unsigned int)fmt.numbytes);
407 DEBUGF("id3 info ----\n"); 409 DEBUGF("id3 info ----\n");
408 DEBUGF(" frquency: %u\n", (unsigned int)id3->frequency); 410 DEBUGF(" frequency: %u\n", (unsigned int)id3->frequency);
409 DEBUGF(" bitrate: %d\n", id3->bitrate); 411 DEBUGF(" bitrate: %d\n", id3->bitrate);
410 DEBUGF(" length: %u\n", (unsigned int)id3->length); 412 DEBUGF(" length: %u\n", (unsigned int)id3->length);
411 413