From 5d5da39ddc1094e563e7bb81070f821cdb722cca Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Fri, 12 Oct 2012 23:07:15 +0200 Subject: [PATCH] amstream: Cleanup MediaStreamFilterImpl_QueryInterface. --- dlls/amstream/mediastreamfilter.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/dlls/amstream/mediastreamfilter.c b/dlls/amstream/mediastreamfilter.c index 194914e70ab..8423cfa4ca9 100644 --- a/dlls/amstream/mediastreamfilter.c +++ b/dlls/amstream/mediastreamfilter.c @@ -102,29 +102,22 @@ static const BaseInputPinFuncTable input_BaseInputFuncTable = { /*** IUnknown methods ***/ -static HRESULT WINAPI MediaStreamFilterImpl_QueryInterface(IMediaStreamFilter *iface, REFIID riid, - void **ppv) +static HRESULT WINAPI MediaStreamFilterImpl_QueryInterface(IMediaStreamFilter *iface, REFIID riid, void **ret_iface) { - IMediaStreamFilterImpl *This = impl_from_IMediaStreamFilter(iface); + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ret_iface); - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); + *ret_iface = NULL; - *ppv = NULL; + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IPersist) || + IsEqualIID(riid, &IID_IMediaFilter) || + IsEqualIID(riid, &IID_IBaseFilter) || + IsEqualIID(riid, &IID_IMediaStreamFilter)) + *ret_iface = iface; - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IMediaStreamFilter)) - *ppv = This; - - if (*ppv) + if (*ret_iface) { - IUnknown_AddRef((IUnknown *)(*ppv)); + IMediaStreamFilter_AddRef(*ret_iface); return S_OK; }