Index: libs/gst/base/gstbasesrc.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/libs/gst/base/gstbasesrc.c,v
retrieving revision 1.96
diff -u -p -r1.96 gstbasesrc.c
--- libs/gst/base/gstbasesrc.c	24 Feb 2006 10:57:42 -0000	1.96
+++ libs/gst/base/gstbasesrc.c	6 Mar 2006 17:37:43 -0000
@@ -1269,21 +1269,37 @@ gst_base_src_pad_get_range (GstPad * pad
 static gboolean
 gst_base_src_check_get_range (GstPad * pad)
 {
+  GstBaseSrcClass *bclass;
   GstBaseSrc *src;
   gboolean res;
 
   src = GST_BASE_SRC (gst_pad_get_parent (pad));
 
-  if (!GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_STARTED)) {
-    gst_base_src_start (src);
-    gst_base_src_stop (src);
+  if (GST_OBJECT_FLAG_IS_SET (src, GST_BASE_SRC_STARTED))
+    goto already_started;
+
+  bclass = GST_BASE_SRC_GET_CLASS (src);
+
+  if (bclass->check_get_range != NULL &&
+      bclass->check_get_range (src, &res)) {
+    GST_LOG_OBJECT (src, "check_get_range vfunc knows: can_do=%d", (gint) res);
+    goto check_decisive;
   }
 
+  GST_LOG_OBJECT (src, "doing start/stop to find out");
+
+  gst_base_src_start (src);
+  gst_base_src_stop (src);
+
+already_started:
+
   /* we can operate in getrange mode if the native format is bytes
    * and we are seekable, this condition is set in the random_access
    * flag and is set in the _start() method. */
   res = src->random_access;
 
+check_decisive:
+
   gst_object_unref (src);
 
   return res;
Index: libs/gst/base/gstbasesrc.h
===================================================================
RCS file: /cvs/gstreamer/gstreamer/libs/gst/base/gstbasesrc.h,v
retrieving revision 1.34
diff -u -p -r1.34 gstbasesrc.h
--- libs/gst/base/gstbasesrc.h	23 Feb 2006 16:24:36 -0000	1.34
+++ libs/gst/base/gstbasesrc.h	6 Mar 2006 17:37:43 -0000
@@ -168,8 +168,15 @@ struct _GstBaseSrcClass {
   /* notify subclasses of a query */
   gboolean      (*query)        (GstBaseSrc *src, GstQuery *query);
 
+  /* check whether the source would support pull-based operation if
+   * it were to be opened now. A return value of FALSE means the
+   * source does not know. This vfunc is optional, but should be
+   * implemented if possible to avoid unnecessary start/stop cycles. */
+  gboolean      (*check_get_range) (GstBaseSrc *src,
+                                    gboolean   *can_do_pull_range);
+
   /*< private >*/
-  gpointer       _gst_reserved[GST_PADDING_LARGE - 2];
+  gpointer       _gst_reserved[GST_PADDING_LARGE - 3];
 };
 
 GType gst_base_src_get_type (void);
