diff options
author | Max Kellermann <max@duempel.org> | 2009-03-02 18:12:44 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-02 18:12:44 +0100 |
commit | 2f438e5d238840b96414079d17f1b56ab1fba9a5 (patch) | |
tree | bc7f4453279deb3121025b8f546dc4fd0181cff8 /src/tag_id3.c | |
parent | 336f624277933a34a049d1d5e88f1357bf8048d8 (diff) |
tag_id3: parse ID3 tags in AIFF files
Added a small AIFF parser library, code copied from the RIFF parser
(big-endian integers). Look for an "ID3" chunk, and let libid3tag
parse it.
Diffstat (limited to 'src/tag_id3.c')
-rw-r--r-- | src/tag_id3.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/tag_id3.c b/src/tag_id3.c index 7cf82c10..2193f2e7 100644 --- a/src/tag_id3.c +++ b/src/tag_id3.c @@ -19,6 +19,7 @@ #include "tag_id3.h" #include "tag.h" #include "riff.h" +#include "aiff.h" #include "conf.h" #include <glib.h> @@ -426,7 +427,7 @@ static struct id3_tag *findId3TagFromEnd(FILE * stream) } static struct id3_tag * -tag_id3_riff_load(FILE *file) +tag_id3_riff_aiff_load(FILE *file) { size_t size; void *buffer; @@ -435,9 +436,11 @@ tag_id3_riff_load(FILE *file) size = riff_seek_id3(file); if (size == 0) + size = aiff_seek_id3(file); + if (size == 0) return NULL; - if (size > 65536) + if (size > 256 * 1024) /* too large, don't allocate so much memory */ return NULL; @@ -469,7 +472,7 @@ struct tag *tag_id3_load(const char *file) tag = findId3TagFromBeginning(stream); if (tag == NULL) - tag = tag_id3_riff_load(stream); + tag = tag_id3_riff_aiff_load(stream); if (!tag) tag = findId3TagFromEnd(stream); |