From e5f3ae1b60527da408bad773bec56dc76ee44286 Mon Sep 17 00:00:00 2001 From: APTX Date: Sun, 16 Feb 2014 14:05:29 +0100 Subject: [PATCH] Force loading of vobsub. --- aniplayer_dshow/aniplayerdshowinternal.cpp | 28 ++++++++++++++++++++++ aniplayer_dshow/aniplayerdshowinternal.h | 1 + 2 files changed, 29 insertions(+) diff --git a/aniplayer_dshow/aniplayerdshowinternal.cpp b/aniplayer_dshow/aniplayerdshowinternal.cpp index 5f88bcc..d0f301e 100644 --- a/aniplayer_dshow/aniplayerdshowinternal.cpp +++ b/aniplayer_dshow/aniplayerdshowinternal.cpp @@ -20,6 +20,8 @@ void _FreeMediaType(AM_MEDIA_TYPE& mt); void _DeleteMediaType(AM_MEDIA_TYPE *pmt); DEFINE_GUID(MEDIATYPE_Subtitle, 0xE487EB08, 0x6B26, 0x4be9, 0x9D, 0xD3, 0x99, 0x34, 0x34, 0xD3, 0x13, 0xFD); +DEFINE_GUID(CLSID_VSFilter, 0x9852A670, 0xF845, 0x491B, 0x9B, 0xE6, 0xEB, 0xD8, 0x41, 0xB8, 0xA6, 0x13); +DEFINE_GUID(CLSID_VSFilter_no_autoload, 0x93A22E7A, 0x5091, 0x45EF, 0xBA, 0x61, 0x6D, 0xA2, 0x61, 0x56, 0xA5, 0xD0); AniPlayerDShowInternal::AniPlayerDShowInternal(AniPlayerDShow *player_) : player(player_) { @@ -33,6 +35,8 @@ AniPlayerDShowInternal::AniPlayerDShowInternal(AniPlayerDShow *player_) : player pAudioControl = 0; + vobsub = 0; + mutedVolume = -1; HRESULT hr; @@ -296,6 +300,29 @@ HRESULT AniPlayerDShowInternal::InitializeGraph() goto done; } + IGraphConfig *pConfig = NULL; + { + HRESULT hr = pGraph->QueryInterface(IID_PPV_ARGS(&pConfig)); + if (FAILED(hr)) + { + goto done; + } + + hr = CoCreateInstance(CLSID_VSFilter, NULL, CLSCTX_INPROC_SERVER, + IID_PPV_ARGS(&vobsub)); + if (FAILED(hr)) + { + goto done; + } + + hr = pConfig->AddFilterToCache(vobsub); + if (FAILED(hr)) + { + goto done; + } + + } + SafeRelease(&pConfig); // m_state = STATE_STOPPED; done: @@ -319,6 +346,7 @@ void AniPlayerDShowInternal::TearDownGraph() SafeRelease(&pEvent); SafeRelease(&pSeeking); SafeRelease(&pAudioControl); + SafeRelease(&vobsub); // delete m_pVideo; // pVideo = NULL; diff --git a/aniplayer_dshow/aniplayerdshowinternal.h b/aniplayer_dshow/aniplayerdshowinternal.h index ea85231..998349f 100644 --- a/aniplayer_dshow/aniplayerdshowinternal.h +++ b/aniplayer_dshow/aniplayerdshowinternal.h @@ -78,6 +78,7 @@ public: AniPlayerDShow *player; QList streamFilters; + IBaseFilter *vobsub; double mutedVolume; }; -- 2.52.0