diff options
author | Casimir666 <casimir666@users.sourceforge.net> | 2009-08-11 23:44:15 +0400 |
---|---|---|
committer | Casimir666 <casimir666@users.sourceforge.net> | 2009-08-11 23:44:15 +0400 |
commit | ab7e958acfb0297d73ae93b56876f8ab97c36bb1 (patch) | |
tree | 10d5c3925626a12325db4c980347f01dd244cd22 /src/filters/parser/matroskasplitter | |
parent | d609d921d75379ba5f0300f457ab2d2d89877eb7 (diff) |
Fix : matroska output pin order changed (subtitle last)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1216 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/matroskasplitter')
-rw-r--r-- | src/filters/parser/matroskasplitter/MatroskaSplitter.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/filters/parser/matroskasplitter/MatroskaSplitter.cpp b/src/filters/parser/matroskasplitter/MatroskaSplitter.cpp index 9f0160fa2..b169e2962 100644 --- a/src/filters/parser/matroskasplitter/MatroskaSplitter.cpp +++ b/src/filters/parser/matroskasplitter/MatroskaSplitter.cpp @@ -115,6 +115,9 @@ HRESULT CMatroskaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) m_pTrackEntryMap.RemoveAll();
m_pOrderedTrackArray.RemoveAll();
+ CAtlArray<CMatroskaSplitterOutputPin*> pinOut;
+ CAtlArray<TrackEntry*> pinOutTE;
+
m_pFile.Attach(DNew CMatroskaFile(pAsyncReader, hr));
if(!m_pFile) return E_OUTOFMEMORY;
if(FAILED(hr)) {m_pFile.Free(); return hr;}
@@ -134,6 +137,8 @@ HRESULT CMatroskaSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader) {
TrackEntry* pTE = pT->TrackEntries.GetNext(pos2);
+ bool isSub = false;
+
if(!pTE->Expand(pTE->CodecPrivate, ContentEncoding::TracksPrivateData))
continue;
@@ -547,6 +552,7 @@ avcsuccess: mt.subtype = MEDIASUBTYPE_NULL;
mt.formattype = FORMAT_None;
mts.Add(mt);
+ isSub = true;
}
else
{
@@ -567,8 +573,10 @@ avcsuccess: CodecID == "S_VOBSUB" ? MEDIASUBTYPE_VOBSUB :
MEDIASUBTYPE_NULL;
- if(mt.subtype != MEDIASUBTYPE_NULL)
+ if(mt.subtype != MEDIASUBTYPE_NULL) {
mts.Add(mt);
+ isSub = true;
+ }
}
}
@@ -587,13 +595,30 @@ avcsuccess: CAutoPtr<CBaseSplitterOutputPin> pPinOut(DNew CMatroskaSplitterOutputPin((int)pTE->MinCache, pTE->DefaultDuration/100, mts, Name, this, this, &hr));
if(!pTE->Name.IsEmpty()) pPinOut->SetProperty(L"NAME", pTE->Name);
if(pTE->Language.GetLength() == 3) pPinOut->SetProperty(L"LANG", CStringW(CString(pTE->Language)));
- AddOutputPin((DWORD)pTE->TrackNumber, pPinOut);
+
+ if (!isSub) {
+ pinOut.InsertAt((iVideo+iAudio-3),DNew CMatroskaSplitterOutputPin((int)pTE->MinCache, pTE->DefaultDuration/100, mts, Name, this, this, &hr),1);
+ pinOutTE.InsertAt((iVideo+iAudio-3),pTE,1);
+ } else {
+ pinOut.Add(DNew CMatroskaSplitterOutputPin((int)pTE->MinCache, pTE->DefaultDuration/100, mts, Name, this, this, &hr));
+ pinOutTE.Add(pTE);
+ }
- m_pTrackEntryMap[(DWORD)pTE->TrackNumber] = pTE;
- m_pOrderedTrackArray.Add(pTE);
}
}
+ for(int i = 0; i < pinOut.GetCount(); i++) {
+
+ CAutoPtr<CBaseSplitterOutputPin> pPinOut;
+ pPinOut.Attach(pinOut[i]);
+ TrackEntry* pTE = pinOutTE[i];
+
+ AddOutputPin((DWORD)pTE->TrackNumber, pPinOut);
+ m_pTrackEntryMap[(DWORD)pTE->TrackNumber] = pTE;
+ m_pOrderedTrackArray.Add(pTE);
+ }
+
+
Info& info = m_pFile->m_segment.SegmentInfo;
if(m_pFile->IsRandomAccess())
|