aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/it_extractor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/it_extractor.c')
-rw-r--r--src/plugins/it_extractor.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/src/plugins/it_extractor.c b/src/plugins/it_extractor.c
index 3d8803f..336392f 100644
--- a/src/plugins/it_extractor.c
+++ b/src/plugins/it_extractor.c
@@ -72,8 +72,8 @@ EXTRACTOR_it_extract_method (struct EXTRACTOR_ExtractContext *ec)
72 72
73 if ((ssize_t) HEADER_SIZE > 73 if ((ssize_t) HEADER_SIZE >
74 ec->read (ec->cls, 74 ec->read (ec->cls,
75 &data, 75 &data,
76 HEADER_SIZE)) 76 HEADER_SIZE))
77 return; 77 return;
78 head = (struct Header *) data; 78 head = (struct Header *) data;
79 /* Check "magic" id bytes */ 79 /* Check "magic" id bytes */
@@ -81,40 +81,41 @@ EXTRACTOR_it_extract_method (struct EXTRACTOR_ExtractContext *ec)
81 return; 81 return;
82 /* Mime-type */ 82 /* Mime-type */
83 if (0 != ec->proc (ec->cls, 83 if (0 != ec->proc (ec->cls,
84 "it", 84 "it",
85 EXTRACTOR_METATYPE_MIMETYPE, 85 EXTRACTOR_METATYPE_MIMETYPE,
86 EXTRACTOR_METAFORMAT_UTF8, 86 EXTRACTOR_METAFORMAT_UTF8,
87 "text/plain", 87 "text/plain",
88 "audio/x-mod", 88 "audio/x-mod",
89 strlen ("audio/x-mod") + 1)) 89 strlen ("audio/x-mod") + 1))
90 return; 90 return;
91 91
92 /* Version of Tracker */ 92 /* Version of Tracker */
93 snprintf (itversion, 93 snprintf (itversion,
94 sizeof (itversion), 94 sizeof (itversion),
95 "%d.%d", 95 "%d.%d",
96 (head->version[0] & 0x01), 96 (head->version[0] & 0x01),
97 head->version[1]); 97 head->version[1]);
98 if (0 != ec->proc (ec->cls, 98 if (0 != ec->proc (ec->cls,
99 "it", 99 "it",
100 EXTRACTOR_METATYPE_FORMAT_VERSION, 100 EXTRACTOR_METATYPE_FORMAT_VERSION,
101 EXTRACTOR_METAFORMAT_C_STRING, 101 EXTRACTOR_METAFORMAT_C_STRING,
102 "text/plain", 102 "text/plain",
103 itversion, 103 itversion,
104 strlen (itversion) + 1)) 104 strlen (itversion) + 1))
105 return; 105 return;
106 106
107 /* Song title */ 107 /* Song title */
108 memcpy (&title, head->title, 26); 108 memcpy (&title, head->title, 26);
109 title[26] = '\0'; 109 title[26] = '\0';
110 if (0 != ec->proc (ec->cls, 110 if (0 != ec->proc (ec->cls,
111 "it", 111 "it",
112 EXTRACTOR_METATYPE_TITLE, 112 EXTRACTOR_METATYPE_TITLE,
113 EXTRACTOR_METAFORMAT_C_STRING, 113 EXTRACTOR_METAFORMAT_C_STRING,
114 "text/plain", 114 "text/plain",
115 title, 115 title,
116 strlen (title) + 1)) 116 strlen (title) + 1))
117 return; 117 return;
118} 118}
119 119
120
120/* end of it_extractor.c */ 121/* end of it_extractor.c */