From a20f127d434f4759a090b74a511e7c4514674cb0 Mon Sep 17 00:00:00 2001 From: Ryan Jackson Date: Fri, 15 Jul 2005 23:07:51 +0000 Subject: [PATCH] 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 --- apps/codecs/Tremor/vorbisfile.c | 4 ++++ apps/metadata.c | 41 ++++++++------------------------- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/apps/codecs/Tremor/vorbisfile.c b/apps/codecs/Tremor/vorbisfile.c index bb069c8896..c8fad7372b 100644 --- a/apps/codecs/Tremor/vorbisfile.c +++ b/apps/codecs/Tremor/vorbisfile.c @@ -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 */ diff --git a/apps/metadata.c b/apps/metadata.c index 7b9bb89706..48bf637eb2 100644 --- a/apps/metadata.c +++ b/apps/metadata.c @@ -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);