[matroska] r923 - trunk/DvdMenuXtractor

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-10-26 17:43:41 +0400 (Tue, 26 Oct 2004)
New Revision: 923

Modified:
   trunk/DvdMenuXtractor/VobParser.cpp
Log:
more timecode debugging

Modified: trunk/DvdMenuXtractor/VobParser.cpp
===================================================================
--- trunk/DvdMenuXtractor/VobParser.cpp	2004-10-26 13:21:15 UTC (rev 922)
+++ trunk/DvdMenuXtractor/VobParser.cpp	2004-10-26 13:43:41 UTC (rev 923)
@@ -594,13 +594,24 @@
 		// PTS : Presentation Time Stamp
 		pktinfo.pts = ParsePTS_DTS();
 		bytesLeft -= 5;
+		if (m_bFirstPacket)
+		{
+			m_startpts = pktinfo.pts;
+		}
+		pktinfo.pts -= m_startpts;
 	}
 	if(pes_header_data_content.DTS_flag)
 	{
 		// DTS : Decoding Time Stamp
 		pktinfo.dts = ParsePTS_DTS();
 		bytesLeft -= 5;
+		if (m_bFirstPacket)
+		{
+			m_startdts = pktinfo.dts;
+		}
+		pktinfo.dts -= m_startdts;
 	}
+	m_bFirstPacket = false;
 
 	// Skip the rest
 	SkipNBytes(bytesLeft);
@@ -618,7 +629,7 @@
 	if(m_demuxer)
 	{
 		m_demuxer->ProcessVideoStream(&m_buff[m_index],
-			length - 3 - pes_header_data_content.PES_header_data_len, wxString::Format("DTS %d PTS %d - %d %d\n",pktinfo.dts/90, pktinfo.pts/90, m_startdts/90, m_startpts/90));
+			length - 3 - pes_header_data_content.PES_header_data_len, wxString::Format("DTS %d PTS %d - %d %d\n", (uint32_t)m_startdts/90, (uint32_t)m_startpts/90, (uint32_t)pktinfo.dts/90, (uint32_t)pktinfo.pts/90));
 	}
 }
 
@@ -632,7 +643,7 @@
 	if(m_demuxer)
 	{	
 		m_demuxer->ProcessAudioStream(&m_buff[m_index],
-			length - 3 - pes_header_data_content.PES_header_data_len, StreamID, wxString::Format("DTS %d PTS %d - %d %d\n",pktinfo.dts/90, pktinfo.pts/90, m_startdts/90, m_startpts/90));
+			length - 3 - pes_header_data_content.PES_header_data_len, StreamID, wxString::Format("DTS %d PTS %d - %d %d\n", (uint32_t)m_startdts/90, (uint32_t)m_startpts/90, (uint32_t)pktinfo.dts/90, (uint32_t)pktinfo.pts/90));
 	}
 }
 
@@ -654,7 +665,7 @@
 		if(m_demuxer)
 		{
 			// .sub files the VobSub way (includes the whole packet)
-			m_demuxer->ProcessSubStream(m_buff, DVD_VIDEO_LB_LEN, substreamID, wxString::Format("DTS %d PTS %d - %d %d\n",pktinfo.dts/90, pktinfo.pts/90, m_startdts/90, m_startpts/90));
+			m_demuxer->ProcessSubStream(m_buff, DVD_VIDEO_LB_LEN, substreamID, wxString::Format("DTS %d PTS %d - %d %d\n", (uint32_t)m_startdts/90, (uint32_t)m_startpts/90, (uint32_t)pktinfo.dts/90, (uint32_t)pktinfo.pts/90));
 		}
 	}
 	else if(substreamID >= SUBSTREAM_AC3_LOW && substreamID < SUBSTREAM_AC3_HIGH)
@@ -668,7 +679,7 @@
 		if(m_demuxer)
 		{
 			uint16_t ac3DataLen = length - (m_index - dataStartIndex);
-			m_demuxer->ProcessAC3Stream(&m_buff[m_index], ac3DataLen, substreamID, wxString::Format("DTS %d PTS %d - %d %d\n",pktinfo.dts/90, pktinfo.pts/90, m_startdts/90, m_startpts/90));
+			m_demuxer->ProcessAC3Stream(&m_buff[m_index], ac3DataLen, substreamID, wxString::Format("DTS %d PTS %d - %d %d\n", (uint32_t)m_startdts/90, (uint32_t)m_startpts/90, (uint32_t)pktinfo.dts/90, (uint32_t)pktinfo.pts/90));
 		}
 	}
 	else if(substreamID >= SUBSTREAM_DTS_LOW && substreamID < SUBSTREAM_DTS_HIGH)
@@ -681,7 +692,7 @@
 		if(m_demuxer)
 		{
 			uint16_t ac3DataLen = length - (m_index - dataStartIndex);
-			m_demuxer->ProcessDTSStream(&m_buff[m_index], ac3DataLen, substreamID, wxString::Format("DTS %d PTS %d - %d %d\n",pktinfo.dts/90, pktinfo.pts/90, m_startdts/90, m_startpts/90));
+			m_demuxer->ProcessDTSStream(&m_buff[m_index], ac3DataLen, substreamID, wxString::Format("DTS %d PTS %d - %d %d\n", (uint32_t)m_startdts/90, (uint32_t)m_startpts/90, (uint32_t)pktinfo.dts/90, (uint32_t)pktinfo.pts/90));
 		}
 	}
 	else if(substreamID >= SUBSTREAM_PCM_LOW && substreamID < SUBSTREAM_PCM_HIGH)
@@ -692,7 +703,7 @@
 		if(m_demuxer)
 		{
 			uint16_t ac3DataLen = length - (m_index - dataStartIndex);
-			m_demuxer->ProcessLPCMStream(&m_buff[m_index], ac3DataLen, substreamID, wxString::Format("DTS %d PTS %d - %d %d\n",pktinfo.dts/90, pktinfo.pts/90, m_startdts/90, m_startpts/90));
+			m_demuxer->ProcessLPCMStream(&m_buff[m_index], ac3DataLen, substreamID, wxString::Format("DTS %d PTS %d - %d %d\n", (uint32_t)m_startdts/90, (uint32_t)m_startpts/90, (uint32_t)pktinfo.dts/90, (uint32_t)pktinfo.pts/90));
 		}
 	}
 	else
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.