qtdemux: avoid storing non-time newsegments to push later

This can confuse downstream when they get a byte segment after receiving
the natural time segment from qtdemux that it sends when starting to
push buffers. This is specially the case with parsers that try to
convert the position from byte to time format and might miss the
correct position for playback to start.
This commit is contained in:
Thiago Santos 2013-04-12 10:21:11 -03:00
parent 895525b5cb
commit d1b91c755c

View file

@ -1829,9 +1829,14 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
GST_DEBUG_OBJECT (demux, "received newsegment %" GST_SEGMENT_FORMAT,
&segment);
GST_DEBUG_OBJECT (demux, "new pending_newsegment");
gst_event_replace (&demux->pending_newsegment, event);
demux->upstream_newsegment = TRUE;
if (segment.format == GST_FORMAT_TIME) {
GST_DEBUG_OBJECT (demux, "new pending_newsegment");
gst_event_replace (&demux->pending_newsegment, event);
demux->upstream_newsegment = TRUE;
} else {
GST_DEBUG_OBJECT (demux, "Not storing upstream newsegment, "
"not in time format");
}
/* chain will send initial newsegment after pads have been added */
if (demux->state != QTDEMUX_STATE_MOVIE || !demux->n_streams) {