From c5cba97021c7bdaa92f026b7a3392dcc5070b1ea Mon Sep 17 00:00:00 2001 From: jcdr428 <56721609+jcdr428@users.noreply.github.com> Date: Sat, 21 Mar 2020 22:13:55 +0200 Subject: [PATCH] Fix initializing lastDTS Currently, tsMuxer muxes the first two frames of the first video track before muxing any other track. This is due to metaDemuxer.cpp line 98 'minDts = streamInfo.m_lastDTS;', with m_lastDTS being initialized at zero. The first video packet pts is set to 0, the first dts is set back by one frame. The lastDTS value must be initialized below the value of the first DTS. --- tsMuxer/metaDemuxer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsMuxer/metaDemuxer.h b/tsMuxer/metaDemuxer.h index 58fa4be7..cf44561b 100644 --- a/tsMuxer/metaDemuxer.h +++ b/tsMuxer/metaDemuxer.h @@ -34,7 +34,7 @@ struct StreamInfo m_pid = pid; m_readCnt = 0; m_lastAVRez = AbstractStreamReader::NEED_MORE_DATA; - m_lastDTS = 0; + m_lastDTS = -1000000000; lastReadRez = 0; m_flushed = false; m_timeShift = 0;