summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/metadata/aiff.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/rbcodec/metadata/aiff.c b/lib/rbcodec/metadata/aiff.c
index 6349335561..1bb95f3ed2 100644
--- a/lib/rbcodec/metadata/aiff.c
+++ b/lib/rbcodec/metadata/aiff.c
@@ -41,6 +41,7 @@ bool get_aiff_metadata(int fd, struct mp3entry* id3)
41 unsigned long numSampleFrames = 0; 41 unsigned long numSampleFrames = 0;
42 unsigned long numbytes = 0; 42 unsigned long numbytes = 0;
43 bool is_aifc = false; 43 bool is_aifc = false;
44 char *p=id3->id3v2buf;
44 45
45 if ((lseek(fd, 0, SEEK_SET) < 0) || (read(fd, &buf[0], 12) < 12) || 46 if ((lseek(fd, 0, SEEK_SET) < 0) || (read(fd, &buf[0], 12) < 12) ||
46 (memcmp(&buf[0], "FORM", 4) != 0) || (memcmp(&buf[8], "AIF", 3) != 0) || 47 (memcmp(&buf[0], "FORM", 4) != 0) || (memcmp(&buf[8], "AIF", 3) != 0) ||
@@ -68,7 +69,30 @@ bool get_aiff_metadata(int fd, struct mp3entry* id3)
68 (char*) &buf[0], size, sizeof(buf)); 69 (char*) &buf[0], size, sizeof(buf));
69 } 70 }
70 71
71 if (memcmp(&buf[0], "COMM", 4) == 0) 72
73 if (memcmp(&buf[0], "NAME", 4) == 0)
74 {
75 read_string(fd, p, 512, 20, size);
76 id3->title=p;
77 p+=size;
78 }
79
80 else if (memcmp(&buf[0], "AUTH", 4) == 0)
81 {
82 read_string(fd, p, 512, 20, size);
83 id3->artist=p;
84 p+=size;
85 }
86
87 else if (memcmp(&buf[0], "ANNO", 4) == 0)
88 {
89 read_string(fd, p, 512, 20, size);
90 id3->comment=p;
91 p+=size;
92 }
93
94
95 else if (memcmp(&buf[0], "COMM", 4) == 0)
72 { 96 {
73 if (size > sizeof(buf) || read(fd, &buf[0], size) != (ssize_t)size) 97 if (size > sizeof(buf) || read(fd, &buf[0], size) != (ssize_t)size)
74 return false; 98 return false;