summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2011-03-13 19:59:27 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2011-03-13 19:59:27 +0000
commit8aed244bd8b05e7cc0a61846b3cb82e936f18494 (patch)
tree78333ad1341a5efaa75d81c04885a4c02ded1216
parentff1b2b7fab5bbfa9f81173cdb77a34f08231d0d9 (diff)
downloadrockbox-8aed244bd8b05e7cc0a61846b3cb82e936f18494.tar.gz
rockbox-8aed244bd8b05e7cc0a61846b3cb82e936f18494.tar.bz2
rockbox-8aed244bd8b05e7cc0a61846b3cb82e936f18494.zip
Add up skipped bytes when parsing for valid MPEG headers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29583 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/mp3data.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/mp3data.c b/apps/mp3data.c
index 35b4608396..bb42c94fc6 100644
--- a/apps/mp3data.c
+++ b/apps/mp3data.c
@@ -448,12 +448,16 @@ static void get_vbri_info(struct mp3info *info, unsigned char *buf)
/* Seek to next mpeg header and extract relevant information. */
static int get_next_header_info(int fd, long *bytecount, struct mp3info *info)
{
- unsigned long header = find_next_frame(fd, bytecount, 0x20000, 0);
+ long tmp;
+ unsigned long header = find_next_frame(fd, &tmp, 0x20000, 0);
if(header == 0)
return -1;
if(!mp3headerinfo(info, header))
return -2;
+
+ /* Next header is tmp bytes away. */
+ *bytecount += tmp;
return 0;
}
@@ -461,7 +465,7 @@ static int get_next_header_info(int fd, long *bytecount, struct mp3info *info)
int get_mp3file_info(int fd, struct mp3info *info)
{
unsigned char frame[1800], *vbrheader;
- long bytecount;
+ long bytecount = 0;
int result;
/* Initialize info and frame */