Commit ad71d43f authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

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.
parent ec642338
......@@ -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);
"Synchronizing stream %d with others by advancing time " "from %"
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));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment