Added another call to mcf5249_init_mac in ov_pcm_seek, just in case. Fixed tag corruption bug and allowed non-numeric characters in year and tracknum tags. Added support for composer tag

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7168 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Ryan Jackson 2005-07-15 23:07:51 +00:00
parent 2e884cc85f
commit a20f127d43
2 changed files with 13 additions and 32 deletions

View file

@ -1291,6 +1291,10 @@ int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
if(ret<0)return(ret);
_make_decode_ready(vf);
#if CONFIG_CPU == MCF5249 && !defined(SIMULATOR)
mcf5249_init_mac();
#endif
/* discard leading packets we don't need for the lapping of the
position we want; don't decode them */

View file

@ -872,44 +872,21 @@ static bool get_vorbis_comments (struct mp3entry *entry, int fd)
} else if (strncasecmp(temp, "ARTIST=", 7) == 0) {
name_length = 6;
p = &(entry->artist);
} else if (strncasecmp(temp, "COMPOSER=", 9) == 0) {
name_length = 8;
p = &(entry->composer);
} else if (strncasecmp(temp, "GENRE=", 6) == 0) {
name_length = 5;
p = &(entry->genre_string);
} else if (strncasecmp(temp, "DATE=", 5) == 0) {
int j=0;
/* verify that this is a number */
/* Note: vorbis uses UTF-8 for its comments, so it is
* safe to compare the values against ASCII 0 and 9
*/
while ( j < (comment_length - 5) ) {
if ( (temp[5+j] < '0') || (temp[5+j] > '9') ) {
break;
}
j++;
}
if ( j == (comment_length - 5) ) {
p = NULL;
entry->year = atoi(temp + 5);
}
name_length = 4;
p = &(entry->year_string);
} else if (strncasecmp(temp, "TRACKNUMBER=", 12) == 0) {
int j=0;
/* verify that this is a number */
/* Note: vorbis uses UTF-8 for its comments, so it is
* safe to compare the values against ASCII 0 and 9
*/
while ( j < (comment_length - 12) ) {
if ( (temp[12+j] < '0') || (temp[12+j] > '9') ) {
break;
}
j++;
}
if ( j == (comment_length - 12) ) {
p = NULL;
entry->tracknum = atoi(temp + 12);
}
name_length = 11;
p = &(entry->track_string);
} else {
p = NULL;
}
p = NULL;
}
if (p) {
comment_length -= (name_length + 1);