2008-11-11 Wim Taymans <wim.taymans@collabora.co.uk>
+ * gst-libs/gst/rtp/gstbasertpdepayload.c: (create_segment_event),
+ (gst_base_rtp_depayload_push_full),
+ (gst_base_rtp_depayload_set_gst_timestamp):
+ Fix some cases where a newsegment event was not sent.
+
+2008-11-11 Wim Taymans <wim.taymans@collabora.co.uk>
+
* gst/playback/gstplaybin2.c: (activate_group):
Catch state change errors and stop from the uridecodebin elements
instead of trying to continue in vain.
return res;
}
+static GstEvent *
+create_segment_event (GstBaseRTPDepayload * filter, gboolean update,
+ GstClockTime position)
+{
+ GstEvent *event;
+ GstClockTime stop;
+ GstBaseRTPDepayloadPrivate *priv;
+
+ priv = filter->priv;
+
+ if (priv->npt_stop != -1)
+ stop = priv->npt_stop - priv->npt_start;
+ else
+ stop = -1;
+
+ event = gst_event_new_new_segment_full (update, priv->play_speed,
+ priv->play_scale, GST_FORMAT_TIME, position, stop,
+ position + priv->npt_start);
+
+ return event;
+}
+
static GstFlowReturn
gst_base_rtp_depayload_push_full (GstBaseRTPDepayload * filter,
gboolean do_ts, guint32 rtptime, GstBuffer * out_buf)
if (bclass->set_gst_timestamp && do_ts)
bclass->set_gst_timestamp (filter, rtptime, out_buf);
+ /* if this is the first buffer send a NEWSEGMENT */
+ if (G_UNLIKELY (filter->need_newsegment)) {
+ GstEvent *event;
+
+ event = create_segment_event (filter, FALSE, 0);
+
+ gst_pad_push_event (filter->srcpad, event);
+
+ filter->need_newsegment = FALSE;
+ GST_DEBUG_OBJECT (filter, "Pushed newsegment event on this first buffer");
+ }
+
if (G_UNLIKELY (priv->discont)) {
GST_LOG_OBJECT (filter, "Marking DISCONT on output buffer");
GST_BUFFER_FLAG_SET (out_buf, GST_BUFFER_FLAG_DISCONT);
return gst_base_rtp_depayload_push_full (filter, FALSE, 0, out_buf);
}
-static GstEvent *
-create_segment_event (GstBaseRTPDepayload * filter, gboolean update,
- GstClockTime position)
-{
- GstEvent *event;
- GstClockTime stop;
- GstBaseRTPDepayloadPrivate *priv;
-
- priv = filter->priv;
-
- if (priv->npt_stop != -1)
- stop = priv->npt_stop - priv->npt_start;
- else
- stop = -1;
-
- event = gst_event_new_new_segment_full (update, priv->play_speed,
- priv->play_scale, GST_FORMAT_TIME, position, stop,
- position + priv->npt_start);
-
- return event;
-}
-
/* convert the PacketLost event form a jitterbuffer to a segment update.
* subclasses can override this. */
static gboolean
GST_BUFFER_TIMESTAMP (buf) = priv->timestamp;
if (!GST_CLOCK_TIME_IS_VALID (duration))
GST_BUFFER_DURATION (buf) = priv->duration;
-
- /* if this is the first buffer send a NEWSEGMENT */
- if (G_UNLIKELY (filter->need_newsegment)) {
- GstEvent *event;
-
- event = create_segment_event (filter, FALSE, 0);
-
- gst_pad_push_event (filter->srcpad, event);
-
- filter->need_newsegment = FALSE;
- GST_DEBUG_OBJECT (filter, "Pushed newsegment event on this first buffer");
- }
}
static GstStateChangeReturn