forked from len0rd/rockbox
Got rid of the reset parameter to xxx_unsynched()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4189 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
219d52a86f
commit
187b8ed9df
1 changed files with 8 additions and 12 deletions
|
|
@ -109,7 +109,7 @@ struct tag_resolver {
|
||||||
int (*ppFunc)(struct mp3entry*, char* tag, int bufferpos);
|
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)
|
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);
|
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 i;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
@ -154,9 +154,6 @@ static int read_unsynched(int fd, void *buf, int len, bool reset)
|
||||||
char *wp;
|
char *wp;
|
||||||
char *rp;
|
char *rp;
|
||||||
|
|
||||||
if(reset)
|
|
||||||
global_ff_found = false;
|
|
||||||
|
|
||||||
wp = buf;
|
wp = buf;
|
||||||
|
|
||||||
while(remaining) {
|
while(remaining) {
|
||||||
|
|
@ -173,16 +170,13 @@ static int read_unsynched(int fd, void *buf, int len, bool reset)
|
||||||
return len;
|
return len;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int skip_unsynched(int fd, int len, bool reset)
|
static int skip_unsynched(int fd, int len)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
int remaining = len;
|
int remaining = len;
|
||||||
int rlen;
|
int rlen;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
if(reset)
|
|
||||||
global_ff_found = false;
|
|
||||||
|
|
||||||
while(remaining) {
|
while(remaining) {
|
||||||
rlen = MIN(sizeof(buf), (unsigned int)remaining);
|
rlen = MIN(sizeof(buf), (unsigned int)remaining);
|
||||||
rc = read(fd, buf, rlen);
|
rc = read(fd, buf, rlen);
|
||||||
|
|
@ -425,6 +419,8 @@ static void setid3v2title(int fd, struct mp3entry *entry)
|
||||||
int i;
|
int i;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
global_ff_found = false;
|
||||||
|
|
||||||
/* Bail out if the tag is shorter than 10 bytes */
|
/* Bail out if the tag is shorter than 10 bytes */
|
||||||
if(entry->id3v2len < 10)
|
if(entry->id3v2len < 10)
|
||||||
return;
|
return;
|
||||||
|
|
@ -493,7 +489,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
|
||||||
/* Read frame header and check length */
|
/* Read frame header and check length */
|
||||||
if(version >= ID3_VER_2_3) {
|
if(version >= ID3_VER_2_3) {
|
||||||
if(global_unsynch && 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
|
else
|
||||||
rc = read(fd, header, 10);
|
rc = read(fd, header, 10);
|
||||||
if(rc != 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 */
|
/* found a tag matching one in tagList, and not yet filled */
|
||||||
if(global_unsynch && version <= ID3_VER_2_3)
|
if(global_unsynch && version <= ID3_VER_2_3)
|
||||||
bytesread = read_unsynched(fd, buffer + bufferpos,
|
bytesread = read_unsynched(fd, buffer + bufferpos,
|
||||||
framelen, false);
|
framelen);
|
||||||
else
|
else
|
||||||
bytesread = read(fd, buffer + bufferpos, framelen);
|
bytesread = read(fd, buffer + bufferpos, framelen);
|
||||||
|
|
||||||
|
|
@ -624,7 +620,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
|
||||||
skip it using the total size */
|
skip it using the total size */
|
||||||
|
|
||||||
if(global_unsynch && version <= ID3_VER_2_3) {
|
if(global_unsynch && version <= ID3_VER_2_3) {
|
||||||
skip_unsynched(fd, totframelen, false);
|
skip_unsynched(fd, totframelen);
|
||||||
} else {
|
} else {
|
||||||
if(data_length_ind)
|
if(data_length_ind)
|
||||||
totframelen = data_length_ind;
|
totframelen = data_length_ind;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue