Index: gstpipeline.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstpipeline.c,v
retrieving revision 1.127
diff -u -p -r1.127 gstpipeline.c
--- gstpipeline.c	20 Jan 2006 19:01:59 -0000	1.127
+++ gstpipeline.c	9 Mar 2006 15:30:15 -0000
@@ -64,15 +64,25 @@ enum
   LAST_SIGNAL
 };
 
-#define DEFAULT_DELAY 0
+#define DEFAULT_DELAY           0
+#define DEFAULT_AUTO_FLUSH_BUS  TRUE
 
 enum
 {
   PROP_0,
   PROP_DELAY,
+  PROP_AUTO_FLUSH_BUS
   /* FILL ME */
 };
 
+#define GST_PIPELINE_GET_PRIVATE(obj)  \
+   (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_PIPELINE, GstPipelinePrivate))
+
+struct _GstPipelinePrivate
+{
+  gboolean  auto_flush_bus;
+};
+
 
 static void gst_pipeline_base_init (gpointer g_class);
 static void gst_pipeline_class_init (gpointer g_class, gpointer class_data);
@@ -137,6 +147,8 @@ gst_pipeline_class_init (gpointer g_clas
 
   parent_class = g_type_class_peek_parent (klass);
 
+  g_type_class_add_private (klass, sizeof (GstPipelinePrivate));
+
   gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_pipeline_set_property);
   gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_pipeline_get_property);
 
@@ -146,6 +158,12 @@ gst_pipeline_class_init (gpointer g_clas
           "to spin up to PLAYING in nanoseconds", 0, G_MAXUINT64, DEFAULT_DELAY,
           G_PARAM_READWRITE));
 
+  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_AUTO_FLUSH_BUS,
+      g_param_spec_boolean ("auto-flush-bus", "Auto Flush Bus",
+          "Whether to automatically flush the pipeline's bus when going "
+          "from READY into NULL state", DEFAULT_AUTO_FLUSH_BUS,
+          G_PARAM_READWRITE));
+
   gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_pipeline_dispose);
 
   gstelement_class->send_event = GST_DEBUG_FUNCPTR (gst_pipeline_send_event);
@@ -161,6 +179,9 @@ gst_pipeline_init (GTypeInstance * insta
   GstPipeline *pipeline = GST_PIPELINE (instance);
   GstBus *bus;
 
+  pipeline->priv = GST_PIPELINE_GET_PRIVATE (pipeline);
+  pipeline->priv->auto_flush_bus = DEFAULT_AUTO_FLUSH_BUS;
+
   pipeline->delay = DEFAULT_DELAY;
 
   bus = gst_bus_new ();
@@ -193,6 +214,9 @@ gst_pipeline_set_property (GObject * obj
     case PROP_DELAY:
       pipeline->delay = g_value_get_uint64 (value);
       break;
+    case PROP_AUTO_FLUSH_BUS:
+      pipeline->priv->auto_flush_bus = g_value_get_boolean (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -211,6 +235,9 @@ gst_pipeline_get_property (GObject * obj
     case PROP_DELAY:
       g_value_set_uint64 (value, pipeline->delay);
       break;
+    case PROP_AUTO_FLUSH_BUS:
+      g_value_set_boolean (value, pipeline->priv->auto_flush_bus);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -420,7 +447,11 @@ gst_pipeline_change_state (GstElement * 
     case GST_STATE_CHANGE_READY_TO_NULL:
       GST_OBJECT_LOCK (element);
       if (element->bus) {
-        gst_bus_set_flushing (element->bus, TRUE);
+        if (pipeline->priv->auto_flush_bus) {
+          gst_bus_set_flushing (element->bus, TRUE);
+        } else {
+          GST_INFO_OBJECT (element, "not flushing bus, auto-flushing disabled");
+        }
       }
       GST_OBJECT_UNLOCK (element);
       break;
Index: gstpipeline.h
===================================================================
RCS file: /cvs/gstreamer/gstreamer/gst/gstpipeline.h,v
retrieving revision 1.34
diff -u -p -r1.34 gstpipeline.h
--- gstpipeline.h	24 Nov 2005 09:44:06 -0000	1.34
+++ gstpipeline.h	9 Mar 2006 15:30:16 -0000
@@ -37,6 +37,7 @@ G_BEGIN_DECLS
 
 typedef struct _GstPipeline GstPipeline;
 typedef struct _GstPipelineClass GstPipelineClass;
+typedef struct _GstPipelinePrivate GstPipelinePrivate;
 
 /**
  * GstPipelineFlags:
@@ -70,7 +71,8 @@ struct _GstPipeline {
   GstClockTime   delay;
 
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING];
+  GstPipelinePrivate *priv;
+  gpointer _gst_reserved[GST_PADDING-1];
 };
 
 struct _GstPipelineClass {
