mpegtsdemux: Keep the position increasing.

Don't keep the segment position jumping back and forth
based on stream DTS/PTS, only increase the position
if the new value is larger than the old.
This commit is contained in:
Jan Schmidt 2018-09-20 01:07:34 +10:00
parent 32d650491c
commit b7c4785a22

View file

@ -3051,10 +3051,13 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream,
GST_TIME_FORMAT, (buffer_list ? "list" : ""), GST_TIME_ARGS (stream->pts), GST_TIME_FORMAT, (buffer_list ? "list" : ""), GST_TIME_ARGS (stream->pts),
GST_TIME_ARGS (stream->dts)); GST_TIME_ARGS (stream->dts));
if (GST_CLOCK_TIME_IS_VALID (stream->dts)) if (GST_CLOCK_TIME_IS_VALID (stream->dts)) {
base->out_segment.position = stream->dts; if (stream->dts > base->out_segment.position)
else if (GST_CLOCK_TIME_IS_VALID (stream->pts)) base->out_segment.position = stream->dts;
base->out_segment.position = stream->pts; } else if (GST_CLOCK_TIME_IS_VALID (stream->pts)) {
if (stream->pts > base->out_segment.position)
base->out_segment.position = stream->pts;
}
if (buffer) { if (buffer) {
res = gst_pad_push (stream->pad, buffer); res = gst_pad_push (stream->pad, buffer);