summaryrefslogtreecommitdiff
path: root/gst/matroska
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-05-20 10:56:52 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-05-20 10:57:30 +0300
commit0345ba78f5cf72ef0be2f8b989e57dd73f7f27f4 (patch)
treec435e6b7f32ed1c7a35408455d2c73d82ac38b2e /gst/matroska
parent47a358783e5a7a04733a46b14fdf561750815309 (diff)
matroskademux: Set seek event seqnum in EOS and SEGMENT_DONE messages/events
Also actually store the seqnum in pull mode seeks. See https://bugzilla.gnome.org/show_bug.cgi?id=765935
Diffstat (limited to 'gst/matroska')
-rw-r--r--gst/matroska/matroska-demux.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c
index 70f09e876..da737bd80 100644
--- a/gst/matroska/matroska-demux.c
+++ b/gst/matroska/matroska-demux.c
@@ -2227,6 +2227,7 @@ exit:
demux->to_time = demux->common.segment.position;
else
demux->to_time = GST_CLOCK_TIME_NONE;
+ demux->segment_seqnum = seqnum;
GST_OBJECT_UNLOCK (demux);
/* restart our task since it might have been stopped when we did the
@@ -4730,6 +4731,8 @@ pause:
}
if (demux->common.segment.flags & GST_SEEK_FLAG_SEGMENT) {
+ GstEvent *event;
+ GstMessage *msg;
gint64 stop;
/* for segment playback we need to post when (in stream time)
@@ -4738,11 +4741,16 @@ pause:
stop = demux->last_stop_end;
GST_LOG_OBJECT (demux, "Sending segment done, at end of segment");
- gst_element_post_message (GST_ELEMENT (demux),
- gst_message_new_segment_done (GST_OBJECT (demux), GST_FORMAT_TIME,
- stop));
- gst_matroska_demux_send_event (demux,
- gst_event_new_segment_done (GST_FORMAT_TIME, stop));
+ msg = gst_message_new_segment_done (GST_OBJECT (demux), GST_FORMAT_TIME,
+ stop);
+ if (demux->segment_seqnum)
+ gst_message_set_seqnum (msg, demux->segment_seqnum);
+ gst_element_post_message (GST_ELEMENT (demux), msg);
+
+ event = gst_event_new_segment_done (GST_FORMAT_TIME, stop);
+ if (demux->segment_seqnum)
+ gst_event_set_seqnum (event, demux->segment_seqnum);
+ gst_matroska_demux_send_event (demux, event);
} else {
push_eos = TRUE;
}
@@ -4753,9 +4761,14 @@ pause:
push_eos = TRUE;
}
if (push_eos) {
+ GstEvent *event;
+
/* send EOS, and prevent hanging if no streams yet */
GST_LOG_OBJECT (demux, "Sending EOS, at end of stream");
- if (!gst_matroska_demux_send_event (demux, gst_event_new_eos ()) &&
+ event = gst_event_new_eos ();
+ if (demux->segment_seqnum)
+ gst_event_set_seqnum (event, demux->segment_seqnum);
+ if (!gst_matroska_demux_send_event (demux, event) &&
(ret == GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
(NULL), ("got eos but no streams (yet)"));