From 0b381894dbe20df740394878f4ecad1794186101 Mon Sep 17 00:00:00 2001 From: Noumi Akira Date: Fri, 12 Jun 2009 15:11:03 +0900 Subject: [PATCH] fix pin with no connection. --- Lib/QDecoder/QFilter.h | 11 +++++++++++ Lib/QDecoder/QPin.h | 19 ++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Lib/QDecoder/QFilter.h b/Lib/QDecoder/QFilter.h index bd4654f..54e428f 100644 --- a/Lib/QDecoder/QFilter.h +++ b/Lib/QDecoder/QFilter.h @@ -17,6 +17,7 @@ class ATL_NO_VTABLE QFilter : public IBaseFilter, public IMediaSeeking, + public IAMFilterMiscFlags, public QPinHost { @@ -58,6 +59,7 @@ public: COM_INTERFACE_ENTRY(IMediaFilter) COM_INTERFACE_ENTRY(IBaseFilter) COM_INTERFACE_ENTRY(IMediaSeeking) + COM_INTERFACE_ENTRY(IAMFilterMiscFlags) END_COM_MAP() public: @@ -640,6 +642,15 @@ public: return E_NOTIMPL; } + /* IAMFilterMiscFlags */ + + STDMETHOD_(ULONG, GetMiscFlags)() + { + ATLTRACE("QFilter::GetMiscFlags()\n"); + + return AM_FILTER_MISC_FLAGS_IS_SOURCE; + } + /* */ private: diff --git a/Lib/QDecoder/QPin.h b/Lib/QDecoder/QPin.h index b59fa93..da88908 100644 --- a/Lib/QDecoder/QPin.h +++ b/Lib/QDecoder/QPin.h @@ -190,6 +190,14 @@ public: ATL::CComCritSecLock lock(m_pHost->FilterCSec()); + if (m_ConnectedTo == 0) { + if (pPin != 0) { + *pPin = 0; + } + + return VFW_E_NOT_CONNECTED; + } + if (pPin == 0) { return E_INVALIDARG; } @@ -333,13 +341,14 @@ public: { ATLTRACE("QPinImpl::QueryInternalConnections()\n"); - if (apPin == 0 || nPin == 0) { - return E_INVALIDARG; + if (apPin != 0 && nPin != 0) { + if (*nPin > 0) { + memset(apPin, 0, *nPin * sizeof(IPin*)); + } + *nPin = 0; } - *nPin = 0; - - return S_OK; + return E_NOTIMPL; } /* */ -- 2.11.0