diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-10-19 17:45:34 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-10-19 17:45:34 +0400 |
commit | 149d37a5c77f413fdfccae06d3069946ad67a616 (patch) | |
tree | d63f8923c27480888a0b9142aad7ac21f81144e8 /decoder/LAVVideo | |
parent | 736d0f1f6fd2b968c2f97f12cf86d46f1e63c602 (diff) |
Only allow one copy of LAV Video in a graph branch.
Diffstat (limited to 'decoder/LAVVideo')
-rw-r--r-- | decoder/LAVVideo/LAVVideo.cpp | 11 | ||||
-rw-r--r-- | decoder/LAVVideo/LAVVideo.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp index dc2b18a0..1ef2fcd6 100644 --- a/decoder/LAVVideo/LAVVideo.cpp +++ b/decoder/LAVVideo/LAVVideo.cpp @@ -712,6 +712,17 @@ HRESULT CLAVVideo::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, doubl return __super::NewSegment(tStart, tStop, dRate); } +HRESULT CLAVVideo::CheckConnect(PIN_DIRECTION dir, IPin *pPin) +{ + if (dir == PINDIR_INPUT) { + if (FilterInGraphSafe(pPin, CLSID_LAVVideo, TRUE)) { + DbgLog((LOG_TRACE, 10, L"CLAVVideo::CheckConnect(): LAVVideo is already in this graph branch, aborting.")); + return E_FAIL; + } + } + return __super::CheckConnect(dir, pPin); +} + HRESULT CLAVVideo::BreakConnect(PIN_DIRECTION dir) { DbgLog((LOG_TRACE, 10, L"::BreakConnect")); diff --git a/decoder/LAVVideo/LAVVideo.h b/decoder/LAVVideo/LAVVideo.h index 032b38e1..73685cbe 100644 --- a/decoder/LAVVideo/LAVVideo.h +++ b/decoder/LAVVideo/LAVVideo.h @@ -127,6 +127,7 @@ public: HRESULT NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); HRESULT Receive(IMediaSample *pIn); + HRESULT CheckConnect(PIN_DIRECTION dir, IPin *pPin); HRESULT BreakConnect(PIN_DIRECTION dir); HRESULT CompleteConnect(PIN_DIRECTION dir, IPin *pReceivePin); |