diff options
author | Yoshihisa Uchida <uchida@rockbox.org> | 2010-05-15 10:20:06 +0000 |
---|---|---|
committer | Yoshihisa Uchida <uchida@rockbox.org> | 2010-05-15 10:20:06 +0000 |
commit | fecf90fda951a817219cd13885d3da22c58bdcb5 (patch) | |
tree | 6f62cb75843c5bbdda9393de9b07e929ac61f518 | |
parent | 77ec4b301b32bf1676987fab098194bc23fdf75a (diff) |
mp3: when ID3 tags are not found, search APE tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26048 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/SOURCES | 4 | ||||
-rw-r--r-- | apps/metadata/id3tags.c | 2 | ||||
-rw-r--r-- | apps/metadata/metadata_common.c | 6 | ||||
-rw-r--r-- | apps/metadata/mp3.c | 6 | ||||
-rw-r--r-- | tools/database/SOURCES | 2 |
5 files changed, 14 insertions, 6 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index c6a9e6a79a..2642fa16b1 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -171,12 +171,12 @@ usb_keymaps.c gui/usb_screen.c #endif metadata.c +metadata/ape.c metadata/id3tags.c +metadata/metadata_common.c metadata/mp3.c #if CONFIG_CODEC == SWCODEC -metadata/metadata_common.c metadata/aiff.c -metadata/ape.c metadata/asf.c metadata/adx.c metadata/flac.c diff --git a/apps/metadata/id3tags.c b/apps/metadata/id3tags.c index a32d01589d..e54a17a5b6 100644 --- a/apps/metadata/id3tags.c +++ b/apps/metadata/id3tags.c @@ -45,9 +45,7 @@ #include "metadata.h" #include "mp3data.h" -#if CONFIG_CODEC == SWCODEC #include "metadata_common.h" -#endif #include "metadata_parsers.h" static unsigned long unsync(unsigned long b0, diff --git a/apps/metadata/metadata_common.c b/apps/metadata/metadata_common.c index e1ef9a0d62..4130fcfd14 100644 --- a/apps/metadata/metadata_common.c +++ b/apps/metadata/metadata_common.c @@ -28,7 +28,9 @@ #include "metadata.h" #include "metadata_common.h" #include "metadata_parsers.h" +#if CONFIG_CODEC == SWCODEC #include "replaygain.h" +#endif #include "misc.h" /* Skip an ID3v2 tag if it can be found. We assume the tag is located at the @@ -250,7 +252,7 @@ long parse_tag(const char* name, char* value, struct mp3entry* id3, char* buf, long buf_remaining, enum tagtype type) { long len = 0; - char** p; + char** p = NULL; if ((((strcasecmp(name, "track") == 0) && (type == TAGTYPE_APE))) || ((strcasecmp(name, "tracknumber") == 0) && (type == TAGTYPE_VORBIS))) @@ -331,11 +333,13 @@ long parse_tag(const char* name, char* value, struct mp3entry* id3, { p = &(id3->mb_track_id); } +#if CONFIG_CODEC == SWCODEC else { len = parse_replaygain(name, value, id3, buf, buf_remaining); p = NULL; } +#endif if (p) { diff --git a/apps/metadata/mp3.c b/apps/metadata/mp3.c index c65fb39cd8..d20dffeb27 100644 --- a/apps/metadata/mp3.c +++ b/apps/metadata/mp3.c @@ -190,7 +190,11 @@ bool get_mp3_metadata(int fd, struct mp3entry *entry, const char *filename) /* only seek to end of file if no id3v2 tags were found */ if (!entry->id3v2len) { - setid3v1title(fd, entry); + if (!setid3v1title(fd, entry)) + { + /* when ID3 tags are not found, search APE tags */ + read_ape_tags(fd, entry); + } } if(!entry->length || (entry->filesize < 8 )) diff --git a/tools/database/SOURCES b/tools/database/SOURCES index e66ea603e1..46c9468a01 100644 --- a/tools/database/SOURCES +++ b/tools/database/SOURCES @@ -15,7 +15,9 @@ database.c ../../firmware/logf.c ../../uisimulator/common/io.c #if CONFIG_CODEC != SWCODEC +../../apps/metadata/ape.c ../../apps/metadata/id3tags.c +../../apps/metadata/metadata_common.c ../../apps/metadata/mp3.c #endif /* Caution. metadata files do not add!! */ |