From 24862c2f742e05c2d8e88a81ad579b9828c6e2d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 Jun 2016 20:28:39 +0300 Subject: [PATCH] qtdemux: Forward segments directly if we are operating in PUSH mode on fragmented streams We shouldn't go through segment activation as we will only have a limited understanding of how the whole stream timeline looks like from the moof. We only know about the current fragment, while upstream knows about the whole stream. This fixes seeking in DASH streams, both for seeks after the current moof and for seeks into the current moof. The former would fail because the moof ends and we can't activate any segment, the latter would cause a segment that stops at the moof end, and no further fragments would be played because we end up being EOS. https://bugzilla.gnome.org/show_bug.cgi?id=767071 --- gst/isomp4/qtdemux.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 477694f..d7337a5 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -2164,8 +2164,16 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent, /* map segment to internal qt segments and push on each stream */ if (demux->n_streams) { - gst_event_replace (&demux->pending_newsegment, NULL); - gst_qtdemux_map_and_push_segments (demux, &segment); + if (demux->fragmented) { + GstEvent *segment_event = gst_event_new_segment (&segment); + + gst_event_replace (&demux->pending_newsegment, NULL); + gst_event_set_seqnum (segment_event, demux->segment_seqnum); + gst_qtdemux_push_event (demux, segment_event); + } else { + gst_event_replace (&demux->pending_newsegment, NULL); + gst_qtdemux_map_and_push_segments (demux, &segment); + } } /* clear leftover in current segment, if any */ -- 2.7.4