summaryrefslogtreecommitdiff
path: root/gst/mpegtsdemux
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-05-06 15:17:24 +0100
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2015-05-15 14:50:35 +0100
commit1dd94be32659fd8afb03091742c84b0d0c62ba7f (patch)
treecf783fbfb0ff4e980c13a44df9d36c1eef25ce61 /gst/mpegtsdemux
parent4a219df3040a99dd935ef23c15afb132266ec1cb (diff)
downloadgstreamer-plugins-bad-1dd94be32659fd8afb03091742c84b0d0c62ba7f.tar.gz
tsdemux: fix buffer timestamp not being in stream time
Timestamps should start at the segment start, rather than 0, so we need to not subtract the first timestamp. This makes the sink correctly account for running time when switching PMTs where a stream starts not quite at zero, causing timing offsets that can become noticeable and causing dropped frames after a few times.
Diffstat (limited to 'gst/mpegtsdemux')
-rw-r--r--gst/mpegtsdemux/tsdemux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c
index 4f0567248..52ed207d5 100644
--- a/gst/mpegtsdemux/tsdemux.c
+++ b/gst/mpegtsdemux/tsdemux.c
@@ -2245,9 +2245,9 @@ 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) - stream->first_dts;
+ demux->segment.position = GST_BUFFER_DTS (buffer);
else if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_PTS (buffer)))
- demux->segment.position = GST_BUFFER_PTS (buffer) - stream->first_dts;
+ demux->segment.position = GST_BUFFER_PTS (buffer);
res = gst_pad_push (stream->pad, buffer);
/* Record that a buffer was pushed */