summaryrefslogtreecommitdiff
path: root/firmware/id3.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2004-01-04 00:45:16 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2004-01-04 00:45:16 +0000
commit187b8ed9dfba6ee5699b7e47a12bb698e293c214 (patch)
tree96a883bd45648aa2aa01d54fa98001a1bc4c7c27 /firmware/id3.c
parent219d52a86f47093868152122d791a84c54b0289b (diff)
Got rid of the reset parameter to xxx_unsynched()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4189 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/id3.c')
-rw-r--r--firmware/id3.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/firmware/id3.c b/firmware/id3.c
index 1fad5ce8d3..fc4e1c11ac 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -109,7 +109,7 @@ struct tag_resolver {
int (*ppFunc)(struct mp3entry*, char* tag, int bufferpos);
};
-static bool global_ff_found = false;
+static bool global_ff_found;
static int unsynchronize(char* tag, int len, bool *ff_found)
{
@@ -146,7 +146,7 @@ static int unsynchronize_frame(char* tag, int len)
return unsynchronize(tag, len, &ff_found);
}
-static int read_unsynched(int fd, void *buf, int len, bool reset)
+static int read_unsynched(int fd, void *buf, int len)
{
int i;
int rc;
@@ -154,9 +154,6 @@ static int read_unsynched(int fd, void *buf, int len, bool reset)
char *wp;
char *rp;
- if(reset)
- global_ff_found = false;
-
wp = buf;
while(remaining) {
@@ -173,16 +170,13 @@ static int read_unsynched(int fd, void *buf, int len, bool reset)
return len;
};
-static int skip_unsynched(int fd, int len, bool reset)
+static int skip_unsynched(int fd, int len)
{
int rc;
int remaining = len;
int rlen;
char buf[32];
- if(reset)
- global_ff_found = false;
-
while(remaining) {
rlen = MIN(sizeof(buf), (unsigned int)remaining);
rc = read(fd, buf, rlen);
@@ -425,6 +419,8 @@ static void setid3v2title(int fd, struct mp3entry *entry)
int i;
int rc;
+ global_ff_found = false;
+
/* Bail out if the tag is shorter than 10 bytes */
if(entry->id3v2len < 10)
return;
@@ -493,7 +489,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
/* Read frame header and check length */
if(version >= ID3_VER_2_3) {
if(global_unsynch && version <= ID3_VER_2_3)
- rc = read_unsynched(fd, header, 10, false);
+ rc = read_unsynched(fd, header, 10);
else
rc = read(fd, header, 10);
if(rc != 10)
@@ -596,7 +592,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
/* found a tag matching one in tagList, and not yet filled */
if(global_unsynch && version <= ID3_VER_2_3)
bytesread = read_unsynched(fd, buffer + bufferpos,
- framelen, false);
+ framelen);
else
bytesread = read(fd, buffer + bufferpos, framelen);
@@ -624,7 +620,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
skip it using the total size */
if(global_unsynch && version <= ID3_VER_2_3) {
- skip_unsynched(fd, totframelen, false);
+ skip_unsynched(fd, totframelen);
} else {
if(data_length_ind)
totframelen = data_length_ind;