forked from len0rd/rockbox
Fix reading of Musicbrainz track IDs from ID3 tags - incorrect return values resulted in these tags being partially overwritten
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20719 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8d24f97c2c
commit
4f47b38938
1 changed files with 8 additions and 8 deletions
|
@ -398,7 +398,8 @@ static int parsembtid( struct mp3entry* entry, char* tag, int bufferpos )
|
||||||
char* value = NULL;
|
char* value = NULL;
|
||||||
int desc_len = strlen(tag);
|
int desc_len = strlen(tag);
|
||||||
/*DEBUGF("MBID len: %d\n", desc_len);*/
|
/*DEBUGF("MBID len: %d\n", desc_len);*/
|
||||||
int value_len = 0;
|
/* Musicbrainz track IDs are always 36 chars long */
|
||||||
|
const size_t mbtid_len = 36;
|
||||||
|
|
||||||
if ((tag - entry->id3v2buf + desc_len + 2) < bufferpos)
|
if ((tag - entry->id3v2buf + desc_len + 2) < bufferpos)
|
||||||
{
|
{
|
||||||
|
@ -406,16 +407,15 @@ static int parsembtid( struct mp3entry* entry, char* tag, int bufferpos )
|
||||||
|
|
||||||
if (strcasecmp(tag, "http://musicbrainz.org") == 0)
|
if (strcasecmp(tag, "http://musicbrainz.org") == 0)
|
||||||
{
|
{
|
||||||
/* Musicbrainz track IDs are always 36 chars long plus null */
|
if (mbtid_len == strlen(value))
|
||||||
value_len = 37;
|
{
|
||||||
|
|
||||||
entry->mb_track_id = value;
|
entry->mb_track_id = value;
|
||||||
|
return bufferpos + mbtid_len + 1;
|
||||||
/*DEBUGF("ENTRY: %s LEN: %d\n", entry->mb_track_id, strlen(entry->mb_track_id));*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tag - entry->id3v2buf + value_len;
|
return bufferpos;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct tag_resolver taglist[] = {
|
static const struct tag_resolver taglist[] = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue