diff options
author | Underground78 <underground78@users.sourceforge.net> | 2014-05-04 22:23:25 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2014-05-12 01:12:24 +0400 |
commit | b971f8c532890347168685ca476cb8290c1d050a (patch) | |
tree | 7b9d5f8f725f564c9a341c2a4f88b01f1ad4f875 /src/filters/transform | |
parent | 4170a165dfcff853ff1e720c989a7769419c6cf0 (diff) |
VSFilter: Use the same subtitle names as the ISR for external subtitles.
Use the video filename to be able to extract more information from the subtitle filenames.
Diffstat (limited to 'src/filters/transform')
-rw-r--r-- | src/filters/transform/VSFilter/DirectVobSubFilter.cpp | 12 | ||||
-rw-r--r-- | src/filters/transform/VSFilter/DirectVobSubFilter.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp index 7182c8531..329cc8542 100644 --- a/src/filters/transform/VSFilter/DirectVobSubFilter.cpp +++ b/src/filters/transform/VSFilter/DirectVobSubFilter.cpp @@ -1431,24 +1431,22 @@ bool CDirectVobSubFilter2::ShouldWeAutoload(IFilterGraph* pGraph) // find file name
- CStringW fn;
-
BeginEnumFilters(pGraph, pEF, pBF) {
if (CComQIPtr<IFileSourceFilter> pFSF = pBF) {
LPOLESTR fnw = nullptr;
if (!pFSF || FAILED(pFSF->GetCurFile(&fnw, nullptr)) || !fnw) {
continue;
}
- fn = CString(fnw);
+ m_videoFileName = CString(fnw);
CoTaskMemFree(fnw);
break;
}
}
EndEnumFilters;
- if ((m_fExternalLoad || m_fWebLoad) && (m_fWebLoad || !(wcsstr(fn, L"http://") || wcsstr(fn, L"mms://")))) {
+ if ((m_fExternalLoad || m_fWebLoad) && (m_fWebLoad || !(wcsstr(m_videoFileName, L"http://") || wcsstr(m_videoFileName, L"mms://")))) {
bool fTemp = m_fHideSubtitles;
- fRet = !fn.IsEmpty() && SUCCEEDED(put_FileName((LPWSTR)(LPCWSTR)fn))
+ fRet = !m_videoFileName.IsEmpty() && SUCCEEDED(put_FileName((LPWSTR)(LPCWSTR)m_videoFileName))
|| SUCCEEDED(put_FileName(L"c:\\tmp.srt"))
|| fRet;
if (fTemp) {
@@ -1524,7 +1522,7 @@ bool CDirectVobSubFilter::Open() if (!pSubStream) {
CAutoPtr<CRenderedTextSubtitle> pRTS(DEBUG_NEW CRenderedTextSubtitle(&m_csSubLock));
- if (pRTS && pRTS->Open(ret[i].fn, DEFAULT_CHARSET) && pRTS->GetStreamCount() > 0) {
+ if (pRTS && pRTS->Open(ret[i].fn, DEFAULT_CHARSET, _T(""), m_videoFileName) && pRTS->GetStreamCount() > 0) {
pSubStream = pRTS.Detach();
m_frd.files.AddTail(ret[i].fn + _T(".style"));
}
@@ -1532,7 +1530,7 @@ bool CDirectVobSubFilter::Open() if (!pSubStream) {
CAutoPtr<CPGSSubFile> pPSF(DEBUG_NEW CPGSSubFile(&m_csSubLock));
- if (pPSF && pPSF->Open(ret[i].fn) && pPSF->GetStreamCount() > 0) {
+ if (pPSF && pPSF->Open(ret[i].fn, _T(""), m_videoFileName) && pPSF->GetStreamCount() > 0) {
pSubStream = pPSF.Detach();
}
}
diff --git a/src/filters/transform/VSFilter/DirectVobSubFilter.h b/src/filters/transform/VSFilter/DirectVobSubFilter.h index a9270a975..e28741717 100644 --- a/src/filters/transform/VSFilter/DirectVobSubFilter.h +++ b/src/filters/transform/VSFilter/DirectVobSubFilter.h @@ -142,6 +142,8 @@ protected: // don't set the "hide subtitles" stream until we are finished with loading
bool m_fLoading;
+ CString m_videoFileName;
+
bool Open();
int FindPreferedLanguage(bool fHideToo = true);
|