diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-04-20 15:29:15 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2016-04-20 15:30:49 +0300 |
commit | d4b3c7391a7c79f03880931ca8a626ed4541b3b2 (patch) | |
tree | bb4759e0d22fdcae9b36a9ad6878346067cbd912 /decoder | |
parent | 5be9dae1eb9cedbf0ca83ba036f4db603a3d169a (diff) |
Block connecting to the "AVI Decompressor" filter from LAV Video
The AVI Decompressor is automatically inserted by the filter graph builder when a filter offers a YUY2 output,
however it doesn't actually support the conversion from LAVs output properly. Instead rely on LAVs RGB output.
This fixes playback of videos embedded into PowerPoint, and similar situations.
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/LAVVideo.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp index d202c200..f0fa5b92 100644 --- a/decoder/LAVVideo/LAVVideo.cpp +++ b/decoder/LAVVideo/LAVVideo.cpp @@ -840,18 +840,25 @@ HRESULT CLAVVideo::CompleteConnect(PIN_DIRECTION dir, IPin *pReceivePin) DbgLog((LOG_TRACE, 10, L"::CompleteConnect")); HRESULT hr = S_OK; if (dir == PINDIR_OUTPUT) { + // Get the filter we're connecting to + IBaseFilter *pFilter = GetFilterFromPin(pReceivePin); + CLSID guidFilter = GUID_NULL; + if (pFilter != nullptr) { + if (FAILED(pFilter->GetClassID(&guidFilter))) + guidFilter = GUID_NULL; + + SafeRelease(&pFilter); + } + + // Don't allow connection to the AVI Decompressor, it doesn't support a variety of our output formats properly + if (guidFilter == CLSID_AVIDec) + return VFW_E_TYPE_NOT_ACCEPTED; + BOOL bFailNonDXVA = false; if (m_pOutput->CurrentMediaType().subtype == MEDIASUBTYPE_P010 || m_pOutput->CurrentMediaType().subtype == MEDIASUBTYPE_P016) { // Check if we're connecting to EVR - IBaseFilter *pFilter = GetFilterFromPin(pReceivePin); - if (pFilter != nullptr) { - CLSID guid; - if (SUCCEEDED(pFilter->GetClassID(&guid))) { - DbgLog((LOG_TRACE, 10, L"-> Connecting P010/P016 to %s", WStringFromGUID(guid).c_str())); - bFailNonDXVA = (guid == CLSID_EnhancedVideoRenderer || guid == CLSID_VideoMixingRenderer9 || guid == CLSID_VideoMixingRenderer); - } - SafeRelease(&pFilter); - } + DbgLog((LOG_TRACE, 10, L"-> Connecting P010/P016 to %s", WStringFromGUID(guidFilter).c_str())); + bFailNonDXVA = (guidFilter == CLSID_EnhancedVideoRenderer || guidFilter == CLSID_VideoMixingRenderer9 || guidFilter == CLSID_VideoMixingRenderer); } hr = m_Decoder.PostConnect(pReceivePin); |