mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gst-libs/gst/rtp/gstbasertpdepayload.c: Fix some cases where a newsegment event was not sent.
Original commit message from CVS: * 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.
This commit is contained in:
parent
79199d884f
commit
c98d4a5031
2 changed files with 41 additions and 34 deletions
|
@ -1,3 +1,10 @@
|
|||
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):
|
||||
|
|
|
@ -450,6 +450,28 @@ gst_base_rtp_depayload_handle_sink_event (GstPad * pad, GstEvent * event)
|
|||
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)
|
||||
|
@ -472,6 +494,18 @@ gst_base_rtp_depayload_push_full (GstBaseRTPDepayload * filter,
|
|||
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);
|
||||
|
@ -529,28 +563,6 @@ gst_base_rtp_depayload_push (GstBaseRTPDepayload * filter, GstBuffer * out_buf)
|
|||
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
|
||||
|
@ -601,18 +613,6 @@ gst_base_rtp_depayload_set_gst_timestamp (GstBaseRTPDepayload * filter,
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue