? gnomevfs-randomaccess.patch
? streaming.diff
? streaming_lock.diff
Index: gstgnomevfssrc.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/gnomevfs/gstgnomevfssrc.c,v
retrieving revision 1.95
diff -u -p -u -r1.95 gstgnomevfssrc.c
--- gstgnomevfssrc.c	10 Oct 2006 12:49:01 -0000	1.95
+++ gstgnomevfssrc.c	16 Nov 2006 08:53:09 -0000
@@ -132,7 +132,8 @@ enum
   ARG_IRADIO_NAME,
   ARG_IRADIO_GENRE,
   ARG_IRADIO_URL,
-  ARG_IRADIO_TITLE
+  ARG_IRADIO_TITLE,
+  ARG_RANDOM_ACCESS
 };
 
 static void gst_gnome_vfs_src_base_init (gpointer g_class);
@@ -254,6 +255,13 @@ gst_gnome_vfs_src_class_init (GstGnomeVF
           "iradio-title",
           "Name of currently playing song", NULL, G_PARAM_READABLE));
 
+  g_object_class_install_property (gobject_class,
+      ARG_RANDOM_ACCESS,
+      g_param_spec_boolean ("random-access",
+          "random-mode",
+          "Enable random file access",
+          FALSE, G_PARAM_READWRITE));
+
   gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_start);
   gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_stop);
   gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_gnome_vfs_src_get_size);
@@ -439,6 +447,9 @@ gst_gnome_vfs_src_set_property (GObject 
     case ARG_IRADIO_MODE:
       src->iradio_mode = g_value_get_boolean (value);
       break;
+    case ARG_RANDOM_ACCESS:
+      src->random_access = g_value_get_boolean (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -475,6 +486,9 @@ gst_gnome_vfs_src_get_property (GObject 
     case ARG_IRADIO_TITLE:
       g_value_set_string (value, src->iradio_title);
       break;
+    case ARG_RANDOM_ACCESS:
+      g_value_set_boolean (value, src->random_access);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -799,11 +813,16 @@ gst_gnome_vfs_src_start (GstBaseSrc * ba
   if (src->uri != NULL) {
     GnomeVFSOpenMode mode;
 
+    if (src->random_access)
+      mode = GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_RANDOM;
+    else
+      mode = GNOME_VFS_OPEN_READ;
+    
     /* this can block... */
-    mode = GNOME_VFS_OPEN_READ;
     res = gnome_vfs_open_uri (&src->handle, src->uri, mode);
-    if (res != GNOME_VFS_OK)
+    if (res != GNOME_VFS_OK) {
       goto open_failed;
+    }
     src->own_handle = TRUE;
   } else if (!src->handle) {
     goto no_filename;
@@ -883,7 +902,14 @@ gst_gnome_vfs_src_stop (GstBaseSrc * bas
   gst_gnome_vfs_src_pop_callbacks (src);
 
   if (src->own_handle) {
-    gnome_vfs_close (src->handle);
+    GnomeVFSResult res;
+    
+    res = gnome_vfs_close (src->handle);
+    if (res != GNOME_VFS_OK) {
+      GST_ELEMENT_ERROR (src, RESOURCE, CLOSE, (NULL),
+          ("Could not close vfs handle: %s",
+              gnome_vfs_result_to_string (res)));
+    }
     src->handle = NULL;
   }
   src->size = (GnomeVFSFileSize) - 1;
Index: gstgnomevfssrc.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/ext/gnomevfs/gstgnomevfssrc.h,v
retrieving revision 1.5
diff -u -p -u -r1.5 gstgnomevfssrc.h
--- gstgnomevfssrc.h	1 Jun 2006 19:19:49 -0000	1.5
+++ gstgnomevfssrc.h	16 Nov 2006 08:53:09 -0000
@@ -74,6 +74,9 @@ struct _GstGnomeVFSSrc
   gchar *iradio_genre;
   gchar *iradio_url;
   gchar *iradio_title;
+  
+  /* random acces read mode */
+  gboolean random_access;
 };
 
 struct _GstGnomeVFSSrcClass
