[MPlayer-cvslog] r37211 - trunk/libmpdemux/demux_ts.c

reimar subversion at mplayerhq.hu
Tue May 27 21:22:10 CEST 2014


Author: reimar
Date: Tue May 27 21:22:10 2014
New Revision: 37211

Log:
demux_ts: Pass through the stream pts.

Copy-paste from MPEG-PS/PES demuxer.
This helps making e.g. seeking more accurate.

Modified:
   trunk/libmpdemux/demux_ts.c

Modified: trunk/libmpdemux/demux_ts.c
==============================================================================
--- trunk/libmpdemux/demux_ts.c	Tue May 27 21:22:09 2014	(r37210)
+++ trunk/libmpdemux/demux_ts.c	Tue May 27 21:22:10 2014	(r37211)
@@ -2715,8 +2715,12 @@ static int fill_packet(demuxer_t *demuxe
 	}
 	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)


More information about the MPlayer-cvslog mailing list