From: Sebastian Dröge Date: Wed, 1 Jun 2016 17:28:39 +0000 (+0300) Subject: qtdemux: Forward segments directly if we are operating in PUSH mode on fragmented... X-Git-Tag: 1.19.3~509^2~2720 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24862c2f742e05c2d8e88a81ad579b9828c6e2d5;p=platform%2Fupstream%2Fgstreamer.git 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 --- 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 */