# HG changeset patch # User Tony Vroon # Date 1239319815 -3600 # Node ID 3b200cf6d1b71e44af90eb7c7bc30af86b2cad9b # Parent d49fca0fc7fd82d6a332f8903a8f216f8ec5c0cd Support comment tag in FLAC files. By Brent Towe, resolves bug #4. diff -r d49fca0fc7fd -r 3b200cf6d1b7 src/flacng/flacng.h --- a/src/flacng/flacng.h Fri Apr 10 00:12:59 2009 +0100 +++ b/src/flacng/flacng.h Fri Apr 10 00:30:15 2009 +0100 @@ -65,6 +65,7 @@ gchar* tracknumber; gchar* genre; gchar* date; + gchar* comment; }; /* diff -r d49fca0fc7fd -r 3b200cf6d1b7 src/flacng/tools.c --- a/src/flacng/tools.c Fri Apr 10 00:12:59 2009 +0100 +++ b/src/flacng/tools.c Fri Apr 10 00:30:15 2009 +0100 @@ -59,6 +59,7 @@ info->comment.tracknumber = NULL; info->comment.genre = NULL; info->comment.date = NULL; + info->comment.comment = NULL; info->replaygain.ref_loud = NULL; info->replaygain.track_gain = NULL; info->replaygain.track_peak = NULL; @@ -141,6 +142,11 @@ info->comment.genre = NULL; } + if (NULL != info->comment.comment) { + free(info->comment.comment); + info->comment.comment = NULL; + } + if (NULL != info->replaygain.ref_loud) { free(info->replaygain.ref_loud); info->replaygain.ref_loud = NULL; @@ -257,6 +263,7 @@ aud_tuple_associate_string(out, FIELD_TITLE, NULL, info->comment.title); aud_tuple_associate_string(out, FIELD_ALBUM, NULL, info->comment.album); aud_tuple_associate_string(out, FIELD_GENRE, NULL, info->comment.genre); + aud_tuple_associate_string(out, FIELD_COMMENT, NULL, info->comment.comment); if (info->comment.tracknumber != NULL) aud_tuple_associate_int(out, FIELD_TRACK_NUMBER, NULL, atoi(info->comment.tracknumber)); @@ -343,6 +350,11 @@ destination = &(info->comment.tracknumber); } + if (0 == strcasecmp(key, "DESCRIPTION")) { + _DEBUG("Found key DESCRIPTION"); + destination = &(info->comment.comment); + } + if (0 == strcasecmp(key, "REPLAYGAIN_REFERENCE_LOUDNESS")) { _DEBUG("Found key REPLAYGAIN_REFERENCE_LOUDNESS"); destination = &(info->replaygain.ref_loud);