amstream: Cleanup MediaStreamFilterImpl_QueryInterface.

This commit is contained in:
Christian Costa 2012-10-12 23:07:15 +02:00 committed by Alexandre Julliard
parent 568c88ccb9
commit 5d5da39ddc
1 changed files with 11 additions and 18 deletions

View File

@ -102,29 +102,22 @@ static const BaseInputPinFuncTable input_BaseInputFuncTable = {
/*** IUnknown methods ***/ /*** IUnknown methods ***/
static HRESULT WINAPI MediaStreamFilterImpl_QueryInterface(IMediaStreamFilter *iface, REFIID riid, static HRESULT WINAPI MediaStreamFilterImpl_QueryInterface(IMediaStreamFilter *iface, REFIID riid, void **ret_iface)
void **ppv)
{ {
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)) if (*ret_iface)
*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)
{ {
IUnknown_AddRef((IUnknown *)(*ppv)); IMediaStreamFilter_AddRef(*ret_iface);
return S_OK; return S_OK;
} }