matroskademux: Advance sparse streams only as much as required to keep the gap smaller than 500ms

Changing it to the newest timestamp that was ever pushed will
increase the segment start in 500ms jumps, which could be just
after the next sparse stream buffer. E.g.

Video at 1.0s, sparse stream at 0.5s would jump the
sparse stream to 1.0s. Now a new sparse stream buffer could
appear that has a timestamp of 0.9s and this would be
dropped for no good reason because of bad luck.
This commit is contained in:
Sebastian Dröge 2010-02-26 18:10:32 +01:00
parent ec642338e3
commit ad71d43f52

View file

@ -3532,19 +3532,21 @@ gst_matroska_demux_sync_streams (GstMatroskaDemux * demux)
GST_CLOCK_TIME_IS_VALID (demux->segment.last_stop) &&
demux->segment.last_stop > demux->segment.start &&
context->pos + (GST_SECOND / 2) < demux->segment.last_stop) {
gint64 new_start;
new_start = demux->segment.last_stop - (GST_SECOND / 2);
GST_DEBUG_OBJECT (demux,
"Synchronizing stream %d with others by advancing time " "from %"
GST_TIME_FORMAT " to %" GST_TIME_FORMAT, stream_nr,
GST_TIME_ARGS (context->pos),
GST_TIME_ARGS (demux->segment.last_stop));
GST_TIME_ARGS (context->pos), GST_TIME_ARGS (new_start));
context->pos = demux->segment.last_stop;
context->pos = new_start;
/* advance stream time */
gst_pad_push_event (context->pad,
gst_event_new_new_segment (TRUE, demux->segment.rate,
demux->segment.format, demux->segment.last_stop,
demux->segment.stop, demux->segment.last_stop));
demux->segment.format, new_start,
demux->segment.stop, new_start));
}
}
}