# HG changeset patch # User reimar # Date 1401218530 0 # Node ID a0a13230b8d18ebfa9d73cc174d60417199ca0c8 # Parent a4c2668dadb6e9c37914d90228cd6a1cd8a0df17 demux_ts: Pass through the stream pts. Copy-paste from MPEG-PS/PES demuxer. This helps making e.g. seeking more accurate. diff -r a4c2668dadb6 -r a0a13230b8d1 libmpdemux/demux_ts.c --- 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)