From 5efa8e1f89784bd814b94f3448f2654c49630fc6 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 5 Jun 2018 17:29:53 +0200 Subject: [PATCH] streamsynchronizer: Properly propagate seqnum on EOS event --- gst/playback/gststreamsynchronizer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index 0066cc1d8e..8380fa418a 100644 --- a/gst/playback/gststreamsynchronizer.c +++ b/gst/playback/gststreamsynchronizer.c @@ -559,6 +559,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent, GSList *pads = NULL; GstPad *srcpad; GstClockTime timestamp; + guint32 seqnum; GST_STREAM_SYNCHRONIZER_LOCK (self); stream = gst_pad_get_element_private (pad); @@ -573,6 +574,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent, seen_data = stream->seen_data; srcpad = gst_object_ref (stream->srcpad); + seqnum = stream->segment_seqnum; if (seen_data && stream->segment.position != -1) timestamp = stream->segment.position; @@ -635,10 +637,13 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent, * send EOS. Or no any valid media data in one track, so decoder can't * get valid CAPS for the track. sink can't ready without received CAPS.*/ if (!seen_data || self->eos) { + GstEvent *topush; GST_DEBUG_OBJECT (pad, "send EOS event"); /* drop lock when sending eos, which may block in e.g. preroll */ + topush = gst_event_new_eos (); + gst_event_set_seqnum (topush, seqnum); GST_STREAM_SYNCHRONIZER_UNLOCK (self); - ret = gst_pad_push_event (srcpad, gst_event_new_eos ()); + ret = gst_pad_push_event (srcpad, topush); GST_STREAM_SYNCHRONIZER_LOCK (self); stream = gst_pad_get_element_private (pad); if (stream) {