mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
tsdemux: fix segment position tracking for the general case
Different streams can have different PTS/DTS bases, and some streams may not even have DTS. https://bugzilla.gnome.org/show_bug.cgi?id=745102
This commit is contained in:
parent
8ebc715fbf
commit
cb0eaeadfd
1 changed files with 5 additions and 1 deletions
|
@ -2221,7 +2221,11 @@ gst_ts_demux_push_pending_data (GstTSDemux * demux, TSDemuxStream * stream)
|
|||
stream->discont = FALSE;
|
||||
|
||||
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS (buffer)))
|
||||
demux->segment.position = GST_BUFFER_DTS (buffer);
|
||||
demux->segment.position = GST_BUFFER_DTS (buffer) - stream->first_dts;
|
||||
else if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_PTS (buffer)))
|
||||
demux->segment.position = GST_BUFFER_PTS (buffer) - stream->first_dts;
|
||||
if (demux->segment.position < 0)
|
||||
demux->segment.position = 0;
|
||||
|
||||
res = gst_pad_push (stream->pad, buffer);
|
||||
/* Record that a buffer was pushed */
|
||||
|
|
Loading…
Reference in a new issue