diff options
author | v0lt <v0lt@users.sourceforge.net> | 2012-02-12 13:46:21 +0400 |
---|---|---|
committer | v0lt <v0lt@users.sourceforge.net> | 2012-02-12 13:46:21 +0400 |
commit | 460c5ecfad49bbd1824972773201d9e4de658f48 (patch) | |
tree | b610f6179c6a0139919fa0f91040cb3576444baf /src/filters/parser/FLVSplitter/FLVSplitter.cpp | |
parent | 4bcb8152b7d1aa719c9ab17bfe0a7e238c750a5d (diff) |
FLVSplitter: fixed a bad search for some flv files
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4065 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/FLVSplitter/FLVSplitter.cpp')
-rw-r--r-- | src/filters/parser/FLVSplitter/FLVSplitter.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/filters/parser/FLVSplitter/FLVSplitter.cpp b/src/filters/parser/FLVSplitter/FLVSplitter.cpp index 4e0376e95..7a69f518c 100644 --- a/src/filters/parser/FLVSplitter/FLVSplitter.cpp +++ b/src/filters/parser/FLVSplitter/FLVSplitter.cpp @@ -776,17 +776,16 @@ void CFLVSplitterFilter::AlternateSeek(REFERENCE_TIME rt) bool hasVideo = !!GetOutputPin(9);
__int64 estimPos = m_DataOffset + 1.0 * rt / m_rtDuration * (m_pFile->GetLength() - m_DataOffset);
- __int64 seekBack = 256 * 1024;
while (true) {
- bool foundAudio = false;
- bool foundVideo = false;
- __int64 bestPos = 0;
-
- estimPos = max(estimPos - seekBack, m_DataOffset);
- seekBack *= 2;
-
- if (Sync(estimPos)) {
+ estimPos -= 256 * 1024;
+ if (estimPos < m_DataOffset) estimPos = m_DataOffset;
+
+ bool foundAudio = !hasAudio;
+ bool foundVideo = !hasVideo;
+ __int64 bestPos = estimPos;
+
+ if (Sync(bestPos)) {
Tag t;
AudioTag at;
VideoTag vt;
@@ -809,15 +808,14 @@ void CFLVSplitterFilter::AlternateSeek(REFERENCE_TIME rt) }
}
- if ((hasAudio && !foundAudio) || (hasVideo && !foundVideo)) {
- if (estimPos == m_DataOffset) {
- m_pFile->Seek(m_DataOffset);
- return;
- }
- } else {
+ if (foundAudio && foundVideo) {
m_pFile->Seek(bestPos);
return;
+ } else if (estimPos == m_DataOffset) {
+ m_pFile->Seek(m_DataOffset);
+ return;
}
+
}
}
|