mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
matroskademux: tweak gap handling
... so as to avoid buffers before and after gap to have identical running time.
This commit is contained in:
parent
06c65418d7
commit
ef1ad78eee
1 changed files with 5 additions and 7 deletions
|
@ -3364,7 +3364,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
||||||
/* handle gaps, e.g. non-zero start-time, or an cue index entry
|
/* handle gaps, e.g. non-zero start-time, or an cue index entry
|
||||||
* that landed us with timestamps not quite intended */
|
* that landed us with timestamps not quite intended */
|
||||||
GST_OBJECT_LOCK (demux);
|
GST_OBJECT_LOCK (demux);
|
||||||
if (GST_CLOCK_TIME_IS_VALID (demux->common.segment.last_stop) &&
|
if (GST_CLOCK_TIME_IS_VALID (demux->last_stop_end) &&
|
||||||
demux->common.segment.rate > 0.0) {
|
demux->common.segment.rate > 0.0) {
|
||||||
GstClockTimeDiff diff;
|
GstClockTimeDiff diff;
|
||||||
GstEvent *event1, *event2;
|
GstEvent *event1, *event2;
|
||||||
|
@ -3372,7 +3372,7 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
||||||
/* only send newsegments with increasing start times,
|
/* only send newsegments with increasing start times,
|
||||||
* otherwise if these go back and forth downstream (sinks) increase
|
* otherwise if these go back and forth downstream (sinks) increase
|
||||||
* accumulated time and running_time */
|
* accumulated time and running_time */
|
||||||
diff = GST_CLOCK_DIFF (demux->common.segment.last_stop, lace_time);
|
diff = GST_CLOCK_DIFF (demux->last_stop_end, lace_time);
|
||||||
if (diff > 2 * GST_SECOND && lace_time > demux->common.segment.start
|
if (diff > 2 * GST_SECOND && lace_time > demux->common.segment.start
|
||||||
&& (!GST_CLOCK_TIME_IS_VALID (demux->common.segment.stop)
|
&& (!GST_CLOCK_TIME_IS_VALID (demux->common.segment.stop)
|
||||||
|| lace_time < demux->common.segment.stop)) {
|
|| lace_time < demux->common.segment.stop)) {
|
||||||
|
@ -3386,11 +3386,9 @@ gst_matroska_demux_parse_blockgroup_or_simpleblock (GstMatroskaDemux * demux,
|
||||||
* accum time, hence running_time */
|
* accum time, hence running_time */
|
||||||
/* close ahead of gap */
|
/* close ahead of gap */
|
||||||
event1 = gst_event_new_new_segment (TRUE,
|
event1 = gst_event_new_new_segment (TRUE,
|
||||||
demux->common.segment.rate,
|
demux->common.segment.rate, demux->common.segment.format,
|
||||||
demux->common.segment.format,
|
demux->last_stop_end, demux->last_stop_end,
|
||||||
demux->common.segment.last_stop,
|
demux->last_stop_end);
|
||||||
demux->common.segment.last_stop,
|
|
||||||
demux->common.segment.last_stop);
|
|
||||||
/* skip gap */
|
/* skip gap */
|
||||||
event2 = gst_event_new_new_segment (FALSE,
|
event2 = gst_event_new_new_segment (FALSE,
|
||||||
demux->common.segment.rate,
|
demux->common.segment.rate,
|
||||||
|
|
Loading…
Reference in a new issue