changeset 37115:a0a13230b8d1

demux_ts: Pass through the stream pts. Copy-paste from MPEG-PS/PES demuxer. This helps making e.g. seeking more accurate.
author reimar
date Tue, 27 May 2014 19:22:10 +0000
parents a4c2668dadb6
children 8e89cf177d51
files libmpdemux/demux_ts.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c	Tue May 27 19:22:09 2014 +0000
+++ b/libmpdemux/demux_ts.c	Tue May 27 19:22:10 2014 +0000
@@ -2715,8 +2715,12 @@
 	}
 	if(*dp)
 	{
+		double stream_pts = MP_NOPTS_VALUE;
 		ret = *dp_offset;
 		resize_demux_packet(*dp, ret);	//shrinked to the right size
+		if (ds == demuxer->video &&
+		    stream_control(demuxer->stream, STREAM_CTRL_GET_CURRENT_TIME, (void *)&stream_pts) != STREAM_UNSUPPORTED)
+			(*dp)->stream_pts = stream_pts;
 		ds_add_packet(ds, *dp);
 		mp_msg(MSGT_DEMUX, MSGL_DBG2, "ADDED %d  bytes to %s fifo, PTS=%.3f\n", ret, (ds == demuxer->audio ? "audio" : (ds == demuxer->video ? "video" : "sub")), (*dp)->pts);
 		if(si)