comparison src/flacng/tools.c @ 3027:3b200cf6d1b7

Support comment tag in FLAC files. By Brent Towe, resolves bug #4.
author Tony Vroon <chainsaw@gentoo.org>
date Fri, 10 Apr 2009 00:30:15 +0100
parents 2cdf6400594c
children
comparison
equal deleted inserted replaced
3026:d49fca0fc7fd 3027:3b200cf6d1b7
57 info->comment.album = NULL; 57 info->comment.album = NULL;
58 info->comment.title = NULL; 58 info->comment.title = NULL;
59 info->comment.tracknumber = NULL; 59 info->comment.tracknumber = NULL;
60 info->comment.genre = NULL; 60 info->comment.genre = NULL;
61 info->comment.date = NULL; 61 info->comment.date = NULL;
62 info->comment.comment = NULL;
62 info->replaygain.ref_loud = NULL; 63 info->replaygain.ref_loud = NULL;
63 info->replaygain.track_gain = NULL; 64 info->replaygain.track_gain = NULL;
64 info->replaygain.track_peak = NULL; 65 info->replaygain.track_peak = NULL;
65 info->replaygain.album_gain = NULL; 66 info->replaygain.album_gain = NULL;
66 info->replaygain.album_peak = NULL; 67 info->replaygain.album_peak = NULL;
139 if (NULL != info->comment.genre) { 140 if (NULL != info->comment.genre) {
140 free(info->comment.genre); 141 free(info->comment.genre);
141 info->comment.genre = NULL; 142 info->comment.genre = NULL;
142 } 143 }
143 144
145 if (NULL != info->comment.comment) {
146 free(info->comment.comment);
147 info->comment.comment = NULL;
148 }
149
144 if (NULL != info->replaygain.ref_loud) { 150 if (NULL != info->replaygain.ref_loud) {
145 free(info->replaygain.ref_loud); 151 free(info->replaygain.ref_loud);
146 info->replaygain.ref_loud = NULL; 152 info->replaygain.ref_loud = NULL;
147 } 153 }
148 154
255 261
256 aud_tuple_associate_string(out, FIELD_ARTIST, NULL, info->comment.artist); 262 aud_tuple_associate_string(out, FIELD_ARTIST, NULL, info->comment.artist);
257 aud_tuple_associate_string(out, FIELD_TITLE, NULL, info->comment.title); 263 aud_tuple_associate_string(out, FIELD_TITLE, NULL, info->comment.title);
258 aud_tuple_associate_string(out, FIELD_ALBUM, NULL, info->comment.album); 264 aud_tuple_associate_string(out, FIELD_ALBUM, NULL, info->comment.album);
259 aud_tuple_associate_string(out, FIELD_GENRE, NULL, info->comment.genre); 265 aud_tuple_associate_string(out, FIELD_GENRE, NULL, info->comment.genre);
266 aud_tuple_associate_string(out, FIELD_COMMENT, NULL, info->comment.comment);
260 267
261 if (info->comment.tracknumber != NULL) 268 if (info->comment.tracknumber != NULL)
262 aud_tuple_associate_int(out, FIELD_TRACK_NUMBER, NULL, atoi(info->comment.tracknumber)); 269 aud_tuple_associate_int(out, FIELD_TRACK_NUMBER, NULL, atoi(info->comment.tracknumber));
263 270
264 if (info->comment.date != NULL) 271 if (info->comment.date != NULL)
339 } 346 }
340 347
341 if (0 == strcasecmp(key, "TRACKNUMBER")) { 348 if (0 == strcasecmp(key, "TRACKNUMBER")) {
342 _DEBUG("Found key TRACKNUMBER"); 349 _DEBUG("Found key TRACKNUMBER");
343 destination = &(info->comment.tracknumber); 350 destination = &(info->comment.tracknumber);
351 }
352
353 if (0 == strcasecmp(key, "DESCRIPTION")) {
354 _DEBUG("Found key DESCRIPTION");
355 destination = &(info->comment.comment);
344 } 356 }
345 357
346 if (0 == strcasecmp(key, "REPLAYGAIN_REFERENCE_LOUDNESS")) { 358 if (0 == strcasecmp(key, "REPLAYGAIN_REFERENCE_LOUDNESS")) {
347 _DEBUG("Found key REPLAYGAIN_REFERENCE_LOUDNESS"); 359 _DEBUG("Found key REPLAYGAIN_REFERENCE_LOUDNESS");
348 destination = &(info->replaygain.ref_loud); 360 destination = &(info->replaygain.ref_loud);