forked from len0rd/rockbox
Skip past id3v2 tag when loading mp3 data
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1729 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
41977da3d5
commit
66f9bccd47
2 changed files with 10 additions and 9 deletions
|
|
@ -44,9 +44,6 @@
|
||||||
((b3 & 0x7F) << (1*7)) | \
|
((b3 & 0x7F) << (1*7)) | \
|
||||||
((b4 & 0x7F) << (0*7)))
|
((b4 & 0x7F) << (0*7)))
|
||||||
|
|
||||||
#define HASID3V2(entry) entry->id3v2len > 0
|
|
||||||
#define HASID3V1(entry) entry->id3v1len > 0
|
|
||||||
|
|
||||||
/* Table of bitrates for MP3 files, all values in kilo.
|
/* Table of bitrates for MP3 files, all values in kilo.
|
||||||
* Indexed by version, layer and value of bit 15-12 in header.
|
* Indexed by version, layer and value of bit 15-12 in header.
|
||||||
*/
|
*/
|
||||||
|
|
@ -596,16 +593,12 @@ bool mp3info(struct mp3entry *entry, char *filename)
|
||||||
entry->id3v2len = getid3v2len(fd);
|
entry->id3v2len = getid3v2len(fd);
|
||||||
entry->tracknum = 0;
|
entry->tracknum = 0;
|
||||||
|
|
||||||
/* Ignore the tag if it is too big */
|
if ( entry->id3v2len && entry->id3v2len <= sizeof( entry->id3v2buf ) )
|
||||||
if(entry->id3v2len > sizeof(entry->id3v2buf))
|
|
||||||
entry->id3v2len = 0;
|
|
||||||
|
|
||||||
if(HASID3V2(entry))
|
|
||||||
setid3v2title(fd, entry);
|
setid3v2title(fd, entry);
|
||||||
entry->length = getsonglength(fd, entry);
|
entry->length = getsonglength(fd, entry);
|
||||||
|
|
||||||
entry->id3v1len = getid3v1len(fd);
|
entry->id3v1len = getid3v1len(fd);
|
||||||
if(HASID3V1(entry) && !entry->title)
|
if(entry->id3v1len && !entry->title)
|
||||||
setid3v1title(fd, entry);
|
setid3v1title(fd, entry);
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
|
||||||
|
|
@ -624,6 +624,10 @@ static int new_file(int steps)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
add_track_to_tag_list(trackname);
|
add_track_to_tag_list(trackname);
|
||||||
|
/* skip past id3v2 tag (to an even byte) */
|
||||||
|
lseek(mpeg_file,
|
||||||
|
id3tags[tag_read_idx]->id3.id3v2len & ~1,
|
||||||
|
SEEK_SET);
|
||||||
}
|
}
|
||||||
} while ( mpeg_file < 0 );
|
} while ( mpeg_file < 0 );
|
||||||
|
|
||||||
|
|
@ -698,6 +702,10 @@ static void mpeg_thread(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
add_track_to_tag_list((char *)ev.data);
|
add_track_to_tag_list((char *)ev.data);
|
||||||
|
/* skip past id3v2 tag (to an even byte) */
|
||||||
|
lseek(mpeg_file,
|
||||||
|
id3tags[tag_read_idx]->id3.id3v2len & ~1,
|
||||||
|
SEEK_SET);
|
||||||
|
|
||||||
/* Make it read more data */
|
/* Make it read more data */
|
||||||
filling = true;
|
filling = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue