Index: rb-metadata-gst.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/metadata/rb-metadata-gst.c,v
retrieving revision 1.44
diff -u -r1.44 rb-metadata-gst.c
--- rb-metadata-gst.c	26 Oct 2005 07:25:13 -0000	1.44
+++ rb-metadata-gst.c	28 Oct 2005 08:15:44 -0000
@@ -99,28 +99,33 @@
 static GstElement *
 rb_add_id3_tagger (GstBin *pipeline, GstElement *element)
 {
-	GstElement *spider;
-	GstElement *tagger;
+        GstElement * tagger, * identity;
 	GstCaps *filtercaps = NULL;
 
-	if (!(spider = gst_element_factory_make ("spider", "spider")))
-		return NULL;
+        if (!(tagger = gst_element_factory_make("id3tag", "tagger"))) 
+                return NULL;
 
-	if (!(tagger = gst_element_factory_make ("id3mux", "id3mux"))) {
-		gst_object_unref (GST_OBJECT (spider));
-		return NULL;
-	}
-
-	gst_bin_add (GST_BIN (pipeline), spider);
-	gst_bin_add (GST_BIN (pipeline), tagger);
-	
-	gst_element_link_many (element, spider, NULL);
-	filtercaps = gst_caps_new_simple ("audio/mpeg", NULL);
-	gst_element_link_filtered (spider, tagger, filtercaps);
+        if (!(identity = gst_element_factory_make("identity", "identity"))) {
+                gst_object_unref( GST_OBJECT(tagger) );
+                return NULL;
+        }
+        
+        gst_bin_add_many (GST_BIN (pipeline), tagger, identity, NULL);
+        
+	filtercaps = gst_caps_new_simple ("application/x-id3", NULL);
+	if (!gst_element_link_filtered (tagger, identity, filtercaps)) {
+		g_warning("Linking id3tag and identity failed");
+                gst_caps_free(filtercaps);
+                gst_object_unref(GST_OBJECT(tagger));
+                gst_object_unref(GST_OBJECT(identity));
+                return NULL;
+        }
 	gst_caps_free (filtercaps);
 
-	return tagger;
-
+        gst_element_link_many(element, tagger, NULL);
+        
+	return identity;
+        
 }
 
 static void
@@ -743,6 +748,7 @@
 		GValue newval = {0,};
 		g_value_init (&newval, gst_tag_get_type (tag));
 		if (g_value_transform (val, &newval)) {
+			g_debug("Setting %s",tag);
 			gst_tag_setter_add_values (GST_TAG_SETTER (tagsetter),
 						   GST_TAG_MERGE_REPLACE,
 						   tag, &newval, NULL);
@@ -774,6 +780,7 @@
 {
 	GstElement *pipeline = NULL;
 	GstElement *gnomevfssrc = NULL;
+        GstElement *retag_end = NULL; /* the last elemet after retagging subpipeline */
 	GstElement *tagger = NULL;
 	const char *plugin_name = NULL;
 	char *tmpname = NULL;
@@ -824,7 +831,16 @@
 		goto out_error;
 	}
 
-	tagger = add_tagger_func (GST_BIN (pipeline), gnomevfssrc);
+	retag_end = add_tagger_func (GST_BIN (pipeline), gnomevfssrc);
+	if (!retag_end) {
+		g_set_error (error,
+			     RB_METADATA_ERROR,
+			     RB_METADATA_ERROR_UNSUPPORTED,
+			     "Unsupported file type: %s", md->priv->type);
+		goto missing_plugin;
+	}
+
+        tagger = gst_bin_get_by_interface(GST_BIN(pipeline), GST_TYPE_TAG_SETTER);
 	if (!tagger) {
 		g_set_error (error,
 			     RB_METADATA_ERROR,
@@ -837,10 +853,9 @@
 	g_hash_table_foreach (md->priv->metadata, 
 			      (GHFunc) rb_metadata_gst_add_tag_data,
 			      GST_TAG_SETTER (tagger));
-
+	
 	gst_bin_add (GST_BIN (pipeline), md->priv->sink); 
-
-	gst_element_link_many (tagger, md->priv->sink, NULL);
+	gst_element_link_many (retag_end, md->priv->sink, NULL);
 
 	md->priv->pipeline = pipeline;
 	gst_element_set_state (pipeline, GST_STATE_PLAYING);
