Index: libs/gst/base/gstbasesink.c
===================================================================
RCS file: /cvs/gstreamer/gstreamer/libs/gst/base/gstbasesink.c,v
retrieving revision 1.194
diff -u -p -r1.194 gstbasesink.c
--- libs/gst/base/gstbasesink.c	28 Nov 2007 13:02:30 -0000	1.194
+++ libs/gst/base/gstbasesink.c	3 Dec 2007 07:15:46 -0000
@@ -210,6 +210,8 @@ struct _GstBaseSinkPrivate
 
   /* the last buffer we prerolled or rendered. Useful for making snapshots */
   GstBuffer *last_buffer;
+  
+  GstEvent *qos_event;
 };
 
 #define DO_RUNNING_AVG(avg,val,size) (((val) + ((size)-1) * (avg)) / (size))
@@ -553,6 +555,9 @@ gst_base_sink_init (GstBaseSink * basesi
   gst_atomic_int_set (&priv->qos_enabled, DEFAULT_QOS);
   priv->async_enabled = DEFAULT_ASYNC;
   priv->ts_offset = DEFAULT_TS_OFFSET;
+  
+  priv->qos_event = gst_event_new_custom (GST_EVENT_QOS,
+    gst_structure_new ("GstEventQOS",NULL));
 
   GST_OBJECT_FLAG_SET (basesink, GST_ELEMENT_IS_SINK);
 }
@@ -563,6 +568,8 @@ gst_base_sink_finalize (GObject * object
   GstBaseSink *basesink;
 
   basesink = GST_BASE_SINK (object);
+  
+  gst_event_unref (basesink->priv->qos_event);
 
   g_queue_free (basesink->preroll_queue);
   gst_segment_free (basesink->abidata.ABI.clip_segment);
@@ -1732,7 +1739,7 @@ stopping:
 
 static gboolean
 gst_base_sink_send_qos (GstBaseSink * basesink,
-    gdouble proportion, GstClockTime time, GstClockTimeDiff diff)
+    gdouble proportion, GstClockTime timestamp, GstClockTimeDiff diff)
 {
   GstEvent *event;
   gboolean res;
@@ -1742,10 +1749,14 @@ gst_base_sink_send_qos (GstBaseSink * ba
       "qos: proportion: %lf, diff %" G_GINT64_FORMAT ", timestamp %"
       GST_TIME_FORMAT, proportion, diff, GST_TIME_ARGS (time));
 
-  event = gst_event_new_qos (proportion, diff, time);
+  event = GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (basesink->priv->qos_event)));
+  gst_structure_set (event->structure,
+    "proportion", G_TYPE_DOUBLE, proportion,
+    "diff", G_TYPE_INT64, diff,
+    "timestamp", G_TYPE_UINT64, timestamp, NULL);
 
   /* send upstream */
-  res = gst_pad_push_event (basesink->sinkpad, event);
+  res = gst_pad_push_event (basesink->sinkpad, gst_event_ref (event));
 
   return res;
 }
