From dffc29eb13c724754ee2aff616f2c6f99399281d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 16 Nov 2007 10:14:34 +0000 Subject: [PATCH] gst-libs/gst/tag/gstid3tag.c: Add mapping for audio cd discid tags, so we can extract them from tags as well (see #34... Original commit message from CVS: * gst-libs/gst/tag/gstid3tag.c: (user_tag_matches), (gst_tag_from_id3_user_tag): Add mapping for audio cd discid tags, so we can extract them from tags as well (see #347848). Also compare identifiers in ID3v2 TXXX frames in a case-insensitive way to increase compatibility when reading tags (discid vs. DiscID vs. DiscId). --- ChangeLog | 9 +++++++++ gst-libs/gst/tag/gstid3tag.c | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6060ec123..3888a72b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-11-16 Tim-Philipp Müller + + * gst-libs/gst/tag/gstid3tag.c: (user_tag_matches), + (gst_tag_from_id3_user_tag): + Add mapping for audio cd discid tags, so we can extract + them from tags as well (see #347848). Also compare identifiers + in ID3v2 TXXX frames in a case-insensitive way to increase + compatibility when reading tags (discid vs. DiscID vs. DiscId). + 2007-11-16 Jan Schmidt * gst-plugins-base.doap: diff --git a/gst-libs/gst/tag/gstid3tag.c b/gst-libs/gst/tag/gstid3tag.c index 574af193b..b32b8fc04 100644 --- a/gst-libs/gst/tag/gstid3tag.c +++ b/gst-libs/gst/tag/gstid3tag.c @@ -249,18 +249,28 @@ static const GstTagEntryMatch user_tag_matches[] = { {GST_TAG_MUSICBRAINZ_ALBUMID, "TXXX|musicbrainz_albumid"}, {GST_TAG_MUSICBRAINZ_ALBUMARTISTID, "TXXX|musicbrainz_albumartistid"}, {GST_TAG_MUSICBRAINZ_TRMID, "TXXX|musicbrainz_trmid"}, + {GST_TAG_CDDA_MUSICBRAINZ_DISCID, "TXXX|musicbrainz_discid"}, /* musicbrainz identifiers according to spec no one pays * attention to (http://musicbrainz.org/docs/specs/metadata_tags.html) */ {GST_TAG_MUSICBRAINZ_ARTISTID, "TXXX|MusicBrainz Artist Id"}, {GST_TAG_MUSICBRAINZ_ALBUMID, "TXXX|MusicBrainz Album Id"}, {GST_TAG_MUSICBRAINZ_ALBUMARTISTID, "TXXX|MusicBrainz Album Artist Id"}, {GST_TAG_MUSICBRAINZ_TRMID, "TXXX|MusicBrainz TRM Id"}, + /* according to: http://wiki.musicbrainz.org/MusicBrainzTag (yes, no space + * before 'ID' and not 'Id' either this time, yay for consistency) */ + {GST_TAG_CDDA_MUSICBRAINZ_DISCID, "TXXX|MusicBrainz DiscID"}, /* foobar2000 uses these identifiers to store gain/peak information in * ID3v2 tags <= v2.3.0. In v2.4.0 there's the RVA2 frame for that */ {GST_TAG_TRACK_GAIN, "TXXX|replaygain_track_gain"}, {GST_TAG_TRACK_PEAK, "TXXX|replaygain_track_peak"}, {GST_TAG_ALBUM_GAIN, "TXXX|replaygain_album_gain"}, - {GST_TAG_ALBUM_PEAK, "TXXX|replaygain_album_peak"} + {GST_TAG_ALBUM_PEAK, "TXXX|replaygain_album_peak"}, + /* the following two are more or less made up, there seems to be little + * evidence that any popular application is actually putting this info + * into TXXX frames; the first one comes from a musicbrainz wiki 'proposed + * tags' page, the second one is analogue to the vorbis/ape/flac tag. */ + {GST_TAG_CDDA_CDDB_DISCID, "TXXX|discid"}, + {GST_TAG_CDDA_CDDB_DISCID, "TXXX|CDDB DiscID"} }; /** @@ -283,7 +293,8 @@ gst_tag_from_id3_user_tag (const gchar * type, const gchar * id3_user_tag) for (i = 0; i < G_N_ELEMENTS (user_tag_matches); ++i) { if (strncmp (type, user_tag_matches[i].original_tag, 4) == 0 && - strcmp (id3_user_tag, user_tag_matches[i].original_tag + 5) == 0) { + g_ascii_strcasecmp (id3_user_tag, + user_tag_matches[i].original_tag + 5) == 0) { GST_LOG ("Mapped ID3v2 user tag '%s' to GStreamer tag '%s'", user_tag_matches[i].original_tag, user_tag_matches[i].gstreamer_tag); return user_tag_matches[i].gstreamer_tag; -- 2.34.1