/* if a stream-start event should be sent */
gboolean stream_start_pending;
- /* if segment should be sent */
+ /* if segment should be sent and a
+ * seqnum if it was originated by a seek */
gboolean segment_pending;
+ guint32 segment_seqnum;
/* if EOS is pending (atomic) */
gint pending_eos;
/* Mark pending segment. Will be sent before next data */
src->priv->segment_pending = TRUE;
+ src->priv->segment_seqnum = gst_util_seqnum_next ();
GST_DEBUG_OBJECT (src,
"Starting new seamless segment. Start %" GST_TIME_FORMAT " stop %"
stop = seeksegment.duration;
src->priv->segment_pending = TRUE;
+ src->priv->segment_seqnum = seqnum;
}
src->priv->discont = TRUE;
/* push events to close/start our segment before we push the buffer. */
if (G_UNLIKELY (src->priv->segment_pending)) {
- gst_pad_push_event (pad, gst_event_new_segment (&src->segment));
+ GstEvent *seg_event = gst_event_new_segment (&src->segment);
+
+ gst_event_set_seqnum (seg_event, src->priv->segment_seqnum);
+ src->priv->segment_seqnum = gst_util_seqnum_next ();
+ gst_pad_push_event (pad, seg_event);
src->priv->segment_pending = FALSE;
}
basesrc->num_buffers_left = basesrc->num_buffers;
basesrc->running = FALSE;
basesrc->priv->segment_pending = FALSE;
+ basesrc->priv->segment_seqnum = gst_util_seqnum_next ();
GST_LIVE_UNLOCK (basesrc);
bclass = GST_BASE_SRC_GET_CLASS (basesrc);