Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorv0lt <v0lt@users.sourceforge.net>2012-02-27 19:47:36 +0400
committerv0lt <v0lt@users.sourceforge.net>2012-02-27 19:47:36 +0400
commit7965643b3098783e429e64f11648ba8678aea3e8 (patch)
tree89939af68cc695aaab43dbdabc65448885545467 /src/filters/parser
parent980a13dc489aadd8c86c382cb2938e8c173f40cd (diff)
MP4Splitter: fixed duration for some mov files (used code from SPlayer)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4103 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser')
-rw-r--r--src/filters/parser/MP4Splitter/MP4Splitter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/filters/parser/MP4Splitter/MP4Splitter.cpp b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
index 4e05c6879..3d1880237 100644
--- a/src/filters/parser/MP4Splitter/MP4Splitter.cpp
+++ b/src/filters/parser/MP4Splitter/MP4Splitter.cpp
@@ -189,6 +189,7 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
m_rtNewStart = m_rtCurrent = 0;
m_rtNewStop = m_rtStop = m_rtDuration = 0;
+ REFERENCE_TIME rtVideoDuration = 0;
m_framesize.SetSize(640, 480);
@@ -757,6 +758,8 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
if (m_rtDuration < rtDuration) {
m_rtDuration = rtDuration;
}
+ if (rtVideoDuration < rtDuration && AP4_Track::TYPE_VIDEO == track->GetType())
+ rtVideoDuration = rtDuration; // get the max video duration
DWORD id = track->GetId();
@@ -913,6 +916,9 @@ HRESULT CMP4SplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
}
}
+ if (rtVideoDuration > 0 && rtVideoDuration < m_rtDuration/2)
+ m_rtDuration = rtVideoDuration; // fix incorrect duration
+
m_rtNewStop = m_rtStop = m_rtDuration;
TRACE(_T("CMP4SplitterFilter m_pOutputs.GetCount() = %d") , m_pOutputs.GetCount());