qtdemux: extract MusicBrainz tags
authorHeath Nielson <heathn@gmail.com>
Mon, 14 Feb 2011 00:49:00 +0000 (00:49 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 14 Feb 2011 00:49:00 +0000 (00:49 +0000)
Extract MusicBrainz tags added by MusicBrainz's Picard
tagger application. These tags (esp. the album id) are
helpful for rhythmbox et.al. to automatically downloads
cover art.

https://bugzilla.gnome.org/show_bug.cgi?id=642205

gst/qtdemux/qtdemux.c

index 80aa6e3..587eb61 100644 (file)
@@ -466,6 +466,8 @@ gst_qtdemux_class_init (GstQTDemuxClass * klass)
 
   gstelement_class->set_index = GST_DEBUG_FUNCPTR (gst_qtdemux_set_index);
   gstelement_class->get_index = GST_DEBUG_FUNCPTR (gst_qtdemux_get_index);
+
+  gst_tag_register_musicbrainz_tags ();
 }
 
 static void
@@ -8023,14 +8025,18 @@ qtdemux_tag_add_revdns (GstQTDemux * demux, const char *tag,
   if (strncmp (meanstr, "com.apple.iTunes", meansize - 12) == 0) {
     static const struct
     {
-      const gchar name[24];
-      const gchar tag[24];
+      const gchar name[28];
+      const gchar tag[28];
     } tags[] = {
       {
       "replaygain_track_gain", GST_TAG_TRACK_GAIN}, {
       "replaygain_track_peak", GST_TAG_TRACK_PEAK}, {
       "replaygain_album_gain", GST_TAG_ALBUM_GAIN}, {
-      "replaygain_album_peak", GST_TAG_ALBUM_PEAK}
+      "replaygain_album_peak", GST_TAG_ALBUM_PEAK}, {
+      "MusicBrainz Track Id", GST_TAG_MUSICBRAINZ_TRACKID}, {
+      "MusicBrainz Artist Id", GST_TAG_MUSICBRAINZ_ARTISTID}, {
+      "MusicBrainz Album Id", GST_TAG_MUSICBRAINZ_ALBUMID}, {
+      "MusicBrainz Album Artist Id", GST_TAG_MUSICBRAINZ_ALBUMARTISTID}
     };
     int i;
 
@@ -8041,6 +8047,9 @@ qtdemux_tag_add_revdns (GstQTDemux * demux, const char *tag,
             qtdemux_add_double_tag_from_str (demux, tags[i].tag,
                 ((guint8 *) data->data) + 16, datasize - 16);
             break;
+          case G_TYPE_STRING:
+            qtdemux_tag_add_str (demux, tags[i].tag, NULL, node);
+            break;
           default:
             /* not reached */
             break;