ext/gio/gstgio.c: Filter http and https protocols. GIO/GVfs handles them but it's...
authorSebastian Dröge <slomo@circular-chaos.org>
Sat, 22 Mar 2008 14:13:55 +0000 (14:13 +0000)
committerSebastian Dröge <slomo@circular-chaos.org>
Sat, 22 Mar 2008 14:13:55 +0000 (14:13 +0000)
Original commit message from CVS:
* ext/gio/gstgio.c: (gst_gio_get_supported_protocols):
Filter http and https protocols. GIO/GVfs handles them but it's
impossible to implement iradio/icecast with it. Better use
souphttpsrc or something else for this.
* ext/gio/gstgiobasesrc.c: (gst_gio_base_src_get_size):
If getting the file informations by a query fails try it with the
seek-to-end trick too.

ChangeLog
ext/gio/gstgio.c
ext/gio/gstgiobasesrc.c

index 4886af4..10258da 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-03-22  Sebastian Dröge  <slomo@circular-chaos.org>
+
+       * ext/gio/gstgio.c: (gst_gio_get_supported_protocols):
+       Filter http and https protocols. GIO/GVfs handles them but it's
+       impossible to implement iradio/icecast with it. Better use
+       souphttpsrc or something else for this.
+
+       * ext/gio/gstgiobasesrc.c: (gst_gio_base_src_get_size):
+       If getting the file informations by a query fails try it with the
+       seek-to-end trick too.
+
 2008-03-21  Sebastian Dröge  <slomo@circular-chaos.org>
 
        * gst/volume/gstvolume.c: (gst_volume_interface_supported),
index 6420d53..1b48bf2 100644 (file)
@@ -29,6 +29,8 @@
 #include "gstgiostreamsink.h"
 #include "gstgiostreamsrc.h"
 
+#include <string.h>
+
 GST_DEBUG_CATEGORY_STATIC (gst_gio_debug);
 #define GST_CAT_DEFAULT gst_gio_debug
 
@@ -94,8 +96,27 @@ gst_gio_seek (gpointer element, GSeekable * stream, guint64 offset,
 static gchar **
 gst_gio_get_supported_protocols (void)
 {
-  return g_strdupv ((gchar **)
-      g_vfs_get_supported_uri_schemes (g_vfs_get_default ()));
+  const gchar *const *schemes;
+  gchar **our_schemes;
+  guint num;
+  gint i;
+
+  schemes = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
+  num = g_strv_length ((gchar **) schemes);
+
+  our_schemes = g_new0 (gchar *, num + 1);
+
+  /* Filter http/https as we can't support the icy stuff with GIO.
+   * Use souphttpsrc if you need that!
+   */
+  for (i = 0; i < num; i++) {
+    if (strcmp (schemes[i], "http") == 0 || strcmp (schemes[i], "https") == 0)
+      continue;
+
+    our_schemes[i] = g_strdup (schemes[i]);
+  }
+
+  return our_schemes;
 }
 
 static GstURIType
index 777d7de..5842cbd 100644 (file)
@@ -189,7 +189,9 @@ gst_gio_base_src_get_size (GstBaseSrc * base_src, guint64 * size)
 
       g_clear_error (&err);
     }
-  } else if (GST_GIO_STREAM_IS_SEEKABLE (src->stream)) {
+  }
+
+  if (GST_GIO_STREAM_IS_SEEKABLE (src->stream)) {
     goffset old;
     goffset stream_size;
     gboolean ret;