ext/gnomevfs/gstgnomevfssrc.*: Don't set icy-caps unless we have a sane interval...
authorMichael Smith <msmith@xiph.org>
Thu, 11 May 2006 10:33:46 +0000 (10:33 +0000)
committerMichael Smith <msmith@xiph.org>
Thu, 11 May 2006 10:33:46 +0000 (10:33 +0000)
Original commit message from CVS:
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_init),
(gst_gnome_vfs_src_received_headers_callback):
* ext/gnomevfs/gstgnomevfssrc.h:
Don't set icy-caps unless we have a sane interval value. Move
interval to a local variable; we never use it outside this function.

ChangeLog
ext/gnomevfs/gstgnomevfssrc.c
ext/gnomevfs/gstgnomevfssrc.h

index adc669e..1222639 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-05-11  Michael Smith  <msmith@fluendo.com>
+
+       * ext/gnomevfs/gstgnomevfssrc.c: (gst_gnome_vfs_src_init),
+       (gst_gnome_vfs_src_received_headers_callback):
+       * ext/gnomevfs/gstgnomevfssrc.h:
+         Don't set icy-caps unless we have a sane interval value. Move
+         interval to a local variable; we never use it outside this function.
+
 2006-05-11  Wim Taymans  <wim@fluendo.com>
 
        * sys/ximage/ximagesink.c: (gst_ximagesink_get_type):
index 9886eb6..8f9e562 100644 (file)
@@ -263,7 +263,6 @@ gst_gnome_vfs_src_init (GstGnomeVFSSrc * gnomevfssrc)
   gnomevfssrc->curoffset = 0;
   gnomevfssrc->seekable = FALSE;
 
-  gnomevfssrc->icy_metaint = 0;
   gnomevfssrc->icy_caps = NULL;
   gnomevfssrc->iradio_mode = FALSE;
   gnomevfssrc->http_callbacks_pushed = FALSE;
@@ -550,11 +549,11 @@ gst_gnome_vfs_src_received_headers_callback (gconstpointer in,
     /* Icecast stuff */
     if (strncmp (data, "icy-metaint:", 12) == 0) {      /* ugh */
       if (sscanf (data + 12, "%d", &icy_metaint) == 1) {
-        src->icy_metaint = icy_metaint;
-        src->icy_caps = gst_caps_new_simple ("application/x-icy",
-            "metadata-interval", G_TYPE_INT, src->icy_metaint, NULL);
-        continue;
+        if (icy_metaint > 0)
+          src->icy_caps = gst_caps_new_simple ("application/x-icy",
+              "metadata-interval", G_TYPE_INT, icy_metaint, NULL);
       }
+      continue;
     }
 
     if (!strncmp (data, "icy-", 4))
index c226cf5..1afe395 100644 (file)
@@ -68,7 +68,6 @@ struct _GstGnomeVFSSrc
   gboolean iradio_mode;
   gboolean http_callbacks_pushed;
 
-  gint icy_metaint;
   GstCaps *icy_caps;
 
   gchar *iradio_name;