Index: ext/gnomevfs/gstgnomevfssrc.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins/ext/gnomevfs/Attic/gstgnomevfssrc.c,v
retrieving revision 1.63.4.3
diff -u -r1.63.4.3 gstgnomevfssrc.c
--- ext/gnomevfs/gstgnomevfssrc.c	5 May 2005 19:23:10 -0000	1.63.4.3
+++ ext/gnomevfs/gstgnomevfssrc.c	15 Jun 2005 11:36:48 -0000
@@ -109,6 +109,7 @@
   gboolean iradio_mode;
   gboolean http_callbacks_pushed;
   gboolean seekable;
+  GstTagList *icy_taglist;
 
   gint icy_metaint;
   GnomeVFSFileSize icy_count;
@@ -692,16 +693,38 @@
 audiocast_do_notifications (GstGnomeVFSSrc * src)
 {
   /* Send any pending notifications we got from the UDP thread. */
-  if (src->iradio_mode) {
-    GList *entry;
+  GList *entry;
+  GstTagList *taglist;
+  gboolean set_taglist = FALSE;
 
-    g_mutex_lock (src->audiocast_queue_mutex);
-    for (entry = src->audiocast_notify_queue; entry; entry = entry->next)
-      g_object_notify (G_OBJECT (src), (const gchar *) entry->data);
-    g_list_free (src->audiocast_notify_queue);
-    src->audiocast_notify_queue = NULL;
-    g_mutex_unlock (src->audiocast_queue_mutex);
+  if (!src->iradio_mode)
+    return;
+
+  if (src->icy_taglist == NULL) {
+    taglist = gst_tag_list_new ();
+  } else {
+    taglist = src->icy_taglist;
+    set_taglist = TRUE;
+  }
+
+  g_mutex_lock (src->audiocast_queue_mutex);
+  for (entry = src->audiocast_notify_queue; entry; entry = entry->next) {
+    g_object_notify (G_OBJECT (src), (const gchar *) entry->data);
+
+    if (strcmp(entry->data, "iradio-url") == 0) {
+      gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, GST_TAG_LOCATION, src->iradio_url, NULL);
+    } else if (strcmp(entry->data, "iradio-title") == 0) {
+      gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, GST_TAG_TITLE, src->iradio_title, NULL);
+    }
   }
+  g_list_free (src->audiocast_notify_queue);
+  src->audiocast_notify_queue = NULL;
+  g_mutex_unlock (src->audiocast_queue_mutex);
+
+  if (set_taglist)
+    src->icy_taglist = taglist;
+  else
+    gst_tag_list_free (taglist);
 }
 
 static gpointer
@@ -861,11 +884,20 @@
   GstGnomeVFSSrc *src = GST_GNOMEVFSSRC (callback_data);
   GnomeVFSModuleCallbackReceivedHeadersIn *in_args =
       (GnomeVFSModuleCallbackReceivedHeadersIn *) in;
+  GstTagList *tags = NULL;
+  gboolean set_taglist = FALSE;
 
   /* This is only used for internet radio stuff right now */
   if (!src->iradio_mode)
     return;
 
+  if (src->icy_taglist) {
+    tags = src->icy_taglist;
+    set_taglist = TRUE;
+  } else {
+    tags = gst_tag_list_new ();
+  }
+  
   for (i = in_args->headers; i; i = i->next) {
     char *data = (char *) i->data;
     char *key = data;
@@ -900,20 +932,34 @@
     if (!strncmp (key, "name", 4)) {
       g_free (src->iradio_name);
       src->iradio_name = gst_gnomevfssrc_unicodify (value);
-      if (src->iradio_name)
+      if (src->iradio_name) {
         g_object_notify (G_OBJECT (src), "iradio-name");
+        gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_COMMENT, src->iradio_name, NULL);
+        set_taglist = TRUE;
+      }
     } else if (!strncmp (key, "genre", 5)) {
       g_free (src->iradio_genre);
       src->iradio_genre = gst_gnomevfssrc_unicodify (value);
-      if (src->iradio_genre)
+      if (src->iradio_genre) {
         g_object_notify (G_OBJECT (src), "iradio-genre");
+        gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_GENRE, src->iradio_genre, NULL);
+        set_taglist = TRUE;
+      }
     } else if (!strncmp (key, "url", 3)) {
       g_free (src->iradio_url);
       src->iradio_url = gst_gnomevfssrc_unicodify (value);
-      if (src->iradio_url)
+      if (src->iradio_url) {
         g_object_notify (G_OBJECT (src), "iradio-url");
+        gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_LOCATION, src->iradio_url, NULL);
+        set_taglist = TRUE;
+      }
     }
   }
+
+  if (set_taglist)
+    src->icy_taglist = tags;
+  else
+    gst_tag_list_free (tags);
 }
 
 static void
@@ -956,7 +1002,9 @@
   guchar *data;
   guchar *pos;
   gchar **tags;
+  GstTagList *taglist;
   int i;
+  gboolean set_taglist = FALSE;
 
   GST_DEBUG ("reading icecast metadata");
 
@@ -988,6 +1036,12 @@
 
   data[metadata_length] = 0;
   tags = g_strsplit ((gchar *) data, "';", 0);
+  if (src->icy_taglist) {
+    taglist = src->icy_taglist;
+    set_taglist = TRUE;
+  } else {
+    taglist = gst_tag_list_new ();
+  }
 
   for (i = 0; tags[i]; i++) {
     if (!g_ascii_strncasecmp (tags[i], "StreamTitle=", 12)) {
@@ -996,6 +1050,8 @@
       if (src->iradio_title) {
         GST_DEBUG ("sending notification on icecast title");
         g_object_notify (G_OBJECT (src), "iradio-title");
+        gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, GST_TAG_TITLE, src->iradio_title, NULL);
+        set_taglist = TRUE;
       } else
         g_print ("Unable to convert icecast title \"%s\" to UTF-8!\n",
             tags[i] + 13);
@@ -1006,7 +1062,9 @@
       src->iradio_url = gst_gnomevfssrc_unicodify (tags[i] + 11);
       if (src->iradio_url) {
         GST_DEBUG ("sending notification on icecast url");
-        g_object_notify (G_OBJECT (src), "iradio-url");
+        g_object_notify (G_OBJECT (src), "iradio-url");	
+        gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, GST_TAG_LOCATION, src->iradio_url, NULL);
+        set_taglist = TRUE;
       } else
         g_print ("Unable to convert icecast url \"%s\" to UTF-8!\n",
             tags[i] + 11);
@@ -1014,6 +1072,10 @@
   }
 
   g_strfreev (tags);
+  if (set_taglist)
+    src->icy_taglist = taglist;
+  else
+    gst_tag_list_free (taglist);
 }
 
 /* end of icecast/audiocast metadata extraction support code */
@@ -1043,14 +1105,25 @@
     GST_DEBUG ("Returning EOS");
     return GST_DATA (gst_event_new (GST_EVENT_EOS));
   }
+  
+  /* grab tags from audiocast thread */
+  audiocast_do_notifications (src);
+
+  /* deal with tag list */
+  if (src->icy_taglist) {
+    gst_element_found_tags (GST_ELEMENT (src), src->icy_taglist);
+    GstEvent *event = gst_event_new_tag (src->icy_taglist);
+    gst_object_ref (GST_OBJECT (src));
+    event->src = GST_OBJECT (src);
+    src->icy_taglist = NULL;
+    return GST_DATA (event);
+  }
 
   /* create the buffer */
   /* FIXME: should eventually use a bufferpool for this */
   buf = gst_buffer_new ();
   g_return_val_if_fail (buf, NULL);
 
-  audiocast_do_notifications (src);
-
   if (src->iradio_mode && src->icy_metaint > 0) {
     GST_BUFFER_DATA (buf) = g_malloc0 (src->icy_metaint);
     data = GST_BUFFER_DATA (buf);
@@ -1076,6 +1149,7 @@
     src->curoffset += readbytes;
 
     if (src->icy_count == src->icy_metaint) {
+      /* we'll push the taglist through next time around */
       gst_gnomevfssrc_get_icy_metadata (src);
       src->icy_count = 0;
     }
@@ -1191,8 +1265,6 @@
 
   GST_DEBUG ("size %" G_GINT64_FORMAT, src->size);
 
-  audiocast_do_notifications (src);
-
   if (gnome_vfs_seek (src->handle, GNOME_VFS_SEEK_CURRENT, 0)
       == GNOME_VFS_OK) {
     src->seekable = TRUE;
Index: gst/playback/gstplaybasebin.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins/gst/playback/gstplaybasebin.c,v
retrieving revision 1.62.2.16
diff -u -r1.62.2.16 gstplaybasebin.c
--- gst/playback/gstplaybasebin.c	10 Jun 2005 13:29:53 -0000	1.62.2.16
+++ gst/playback/gstplaybasebin.c	15 Jun 2005 11:36:58 -0000
@@ -1103,6 +1103,11 @@
       !strncmp (play_base_bin->uri, "rtp://", 6) ||
       !strncmp (play_base_bin->uri, "rtsp://", 7);
 
+  /* enable iradio mode for HTTP streams to get icecast metadata */
+  if (!strncmp (play_base_bin->uri, "http://", 7) &&
+      g_object_class_find_property (G_OBJECT_GET_CLASS (source), "iradio-mode"))
+    gst_element_set (source, "iradio-mode", TRUE, NULL);
+  
   return source;
 }
 
Index: gst/playback/gstplaybasebin.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins/gst/playback/gstplaybasebin.h,v
retrieving revision 1.12.2.3
diff -u -r1.12.2.3 gstplaybasebin.h
--- gst/playback/gstplaybasebin.h	1 Apr 2005 11:15:22 -0000	1.12.2.3
+++ gst/playback/gstplaybasebin.h	15 Jun 2005 11:36:59 -0000
@@ -76,6 +76,7 @@
   GstElement	*thread;
   gchar 	*uri, *suburi;
   gboolean	 is_stream;
+  gboolean	 maybe_iradio_stream;
   GstElement	*source;
   GstElement	*decoder;
   GstElement	*subtitle; /* additional filesrc ! subparse bin */
