gboolean update;
GstSegment seeksegment = { 0, };
gint64 last_stop;
+ guint32 seqnum = 0;
if (event) {
GST_DEBUG_OBJECT (wav, "doing seek with event");
gst_event_parse_seek (event, &rate, &format, &flags,
&cur_type, &cur, &stop_type, &stop);
+ seqnum = gst_event_get_seqnum (event);
/* no negative rates yet */
if (rate < 0.0)
/* BYTE seek event */
event = gst_event_new_seek (rate, GST_FORMAT_BYTES, flags, cur_type, cur,
stop_type, stop);
+ gst_event_set_seqnum (event, seqnum);
res = gst_pad_push_event (wav->sinkpad, event);
}
return res;
* as it completes one iteration (and thus might block when the sink is
* blocking in preroll). */
if (flush) {
+ GstEvent *fevent;
GST_DEBUG_OBJECT (wav, "sending flush start");
- gst_pad_push_event (wav->sinkpad, gst_event_new_flush_start ());
- gst_pad_push_event (wav->srcpad, gst_event_new_flush_start ());
+
+ fevent = gst_event_new_flush_start ();
+ gst_event_set_seqnum (fevent, seqnum);
+ gst_pad_push_event (wav->sinkpad, gst_event_ref (fevent));
+ gst_pad_push_event (wav->srcpad, fevent);
} else {
gst_pad_pause_task (wav->sinkpad);
}
/* prepare for streaming again */
if (flush) {
+ GstEvent *fevent;
+
/* if we sent a FLUSH_START, we now send a FLUSH_STOP */
GST_DEBUG_OBJECT (wav, "sending flush stop");
- gst_pad_push_event (wav->sinkpad, gst_event_new_flush_stop (TRUE));
- gst_pad_push_event (wav->srcpad, gst_event_new_flush_stop (TRUE));
+
+ fevent = gst_event_new_flush_stop (TRUE);
+ gst_event_set_seqnum (fevent, seqnum);
+ gst_pad_push_event (wav->sinkpad, gst_event_ref (fevent));
+ gst_pad_push_event (wav->srcpad, fevent);
}
/* now we did the seek and can activate the new segment values */
if (wav->start_segment)
gst_event_unref (wav->start_segment);
wav->start_segment = gst_event_new_segment (&wav->segment);
+ gst_event_set_seqnum (wav->start_segment, seqnum);
/* mark discont if we are going to stream from another position. */
if (last_stop != wav->segment.position) {