diff options
author | Underground78 <underground78@users.sourceforge.net> | 2013-08-22 21:45:23 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2013-09-04 22:04:23 +0400 |
commit | f39c7a6e56b2158c5b46d04237521f3c823ce17b (patch) | |
tree | a7be8413d016afbd8d83076e3f940371603bd671 /src | |
parent | 390ea8f109bcf9e6ee59df1b8cc657599b34ccdb (diff) |
Initial subtitle track selection: Update the special internal splitter case for LAV Splitter.
If the internal splitter has its own language preferences set, we won't override its choice.
Diffstat (limited to 'src')
-rw-r--r-- | src/mpc-hc/MainFrm.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp index e2209784f..06df8cc91 100644 --- a/src/mpc-hc/MainFrm.cpp +++ b/src/mpc-hc/MainFrm.cpp @@ -11608,12 +11608,19 @@ DWORD CMainFrame::SetupSubtitleStreams() CComPtr<ISubStream> pSubStream = subInput.subStream;
CComQIPtr<IAMStreamSelect> pSSF = subInput.sourceFilter;
- bool bAllowOverridingSplitterChoice = s.bAllowOverridingExternalSplitterChoice;
- CLSID clsid;
- if (!bAllowOverridingSplitterChoice && pSSF && SUCCEEDED(subInput.sourceFilter->GetClassID(&clsid))) {
- // We always allow overriding the splitter choice for our splitters that
- // support the IAMStreamSelect interface and thus would have been ignored.
- bAllowOverridingSplitterChoice = !!(clsid == CLSID_MPCMpegSplitter);
+ bool bAllowOverridingSplitterChoice;
+ // If the internal LAV Splitter has its own language preferences set, we choose not to override its choice
+ if (pSSF && CFGFilterLAV::IsInternalInstance(subInput.sourceFilter)) {
+ bAllowOverridingSplitterChoice = true;
+ if (CComQIPtr<ILAVFSettings> pLAVFSettings = subInput.sourceFilter) {
+ LPWSTR langPrefs = nullptr;
+ if (SUCCEEDED(pLAVFSettings->GetPreferredSubtitleLanguages(&langPrefs)) && langPrefs && wcslen(langPrefs)) {
+ bAllowOverridingSplitterChoice = false;
+ }
+ CoTaskMemFree(langPrefs);
+ }
+ } else {
+ bAllowOverridingSplitterChoice = s.bAllowOverridingExternalSplitterChoice;
}
int count = 0;
|