qtdemux: Only activate segments and send SEGMENT events if we have streams

But in that case also remove the pending newsegment event, otherwise we would
later send a possibly outdated event.

https://bugzilla.gnome.org/show_bug.cgi?id=767071
This commit is contained in:
Sebastian Dröge 2016-05-31 17:04:32 +03:00
parent f8eb909d90
commit 84e698c531

View file

@ -2163,7 +2163,10 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
GST_DEBUG_OBJECT (demux, "Pushing newseg %" GST_SEGMENT_FORMAT, &segment);
/* map segment to internal qt segments and push on each stream */
gst_qtdemux_map_and_push_segments (demux, &segment);
if (demux->n_streams) {
gst_event_replace (&demux->pending_newsegment, NULL);
gst_qtdemux_map_and_push_segments (demux, &segment);
}
/* clear leftover in current segment, if any */
gst_adapter_clear (demux->adapter);