From ec5813234bcb09e487b90c79b3b06fb9e6107845 Mon Sep 17 00:00:00 2001 From: Aleksoid Date: Mon, 31 Oct 2011 10:05:07 +0000 Subject: Change : Disable C4067 warning; Fix : MPEGSplitter - correct calculate duration on stream with abnormal pts/dts value; Small speed optimization at opening the file; git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3798 10f7b99b-c216-0410-bff0-8a66a9350fd8 --- src/filters/parser/MpegSplitter/MpegSplitterFile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/filters/parser/MpegSplitter') diff --git a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp index 7fc143db7..43099bda0 100644 --- a/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp +++ b/src/filters/parser/MpegSplitter/MpegSplitterFile.cpp @@ -413,7 +413,7 @@ HRESULT CMpegSplitterFile::SearchStreams(__int64 start, __int64 stop, IAsyncRead } if(h2.fpts && CalcDuration && GetMasterStream() && GetMasterStream()->GetHead() == h.pid) { - if(m_rtMin == _I64_MAX) { + if((m_rtMin == _I64_MAX) || (m_rtMin > h2.pts)) { m_rtMin = h2.pts; m_posMin = GetPos(); TRACE ("m_rtMin(SearchStreams)=%S, PID=%d\n", ReftimeToString(m_rtMin), h.pid); @@ -440,14 +440,15 @@ HRESULT CMpegSplitterFile::SearchStreams(__int64 start, __int64 stop, IAsyncRead } } } - //TRACE ("m_rtMax(SearchStreams)=%S\n", ReftimeToString(m_rtMax)); } } } else { b = 0; } - AddStream(h.pid, b, DWORD(h.bytes - (GetPos() - pos))); + if(!CalcDuration) { + AddStream(h.pid, b, DWORD(h.bytes - (GetPos() - pos))); + } } Seek(h.next); -- cgit v1.2.3