quartz/filesource: Use BaseFilterImpl_Release().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3c98e11b60
commit
b9735fc69e
|
@ -403,8 +403,32 @@ static IPin *async_reader_get_pin(BaseFilter *iface, unsigned int index)
|
|||
return This->pOutputPin;
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable BaseFuncTable = {
|
||||
static void async_reader_destroy(BaseFilter *iface)
|
||||
{
|
||||
AsyncReader *filter = impl_from_BaseFilter(iface);
|
||||
|
||||
if (filter->pOutputPin)
|
||||
{
|
||||
IPin *peer;
|
||||
if (SUCCEEDED(IPin_ConnectedTo(filter->pOutputPin, &peer)))
|
||||
{
|
||||
IPin_Disconnect(peer);
|
||||
IPin_Release(peer);
|
||||
}
|
||||
IPin_Disconnect(filter->pOutputPin);
|
||||
IPin_Release(filter->pOutputPin);
|
||||
}
|
||||
CoTaskMemFree(filter->pszFileName);
|
||||
if (filter->pmt)
|
||||
DeleteMediaType(filter->pmt);
|
||||
strmbase_filter_cleanup(&filter->filter);
|
||||
CoTaskMemFree(filter);
|
||||
}
|
||||
|
||||
static const BaseFilterFuncTable BaseFuncTable =
|
||||
{
|
||||
.filter_get_pin = async_reader_get_pin,
|
||||
.filter_destroy = async_reader_destroy,
|
||||
};
|
||||
|
||||
HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv)
|
||||
|
@ -468,37 +492,6 @@ static HRESULT WINAPI AsyncReader_QueryInterface(IBaseFilter * iface, REFIID rii
|
|||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI AsyncReader_Release(IBaseFilter * iface)
|
||||
{
|
||||
AsyncReader *This = impl_from_IBaseFilter(iface);
|
||||
ULONG refCount = InterlockedDecrement(&This->filter.refCount);
|
||||
|
||||
TRACE("%p->() Release from %d\n", This, refCount + 1);
|
||||
|
||||
if (!refCount)
|
||||
{
|
||||
if (This->pOutputPin)
|
||||
{
|
||||
IPin *pConnectedTo;
|
||||
if(SUCCEEDED(IPin_ConnectedTo(This->pOutputPin, &pConnectedTo)))
|
||||
{
|
||||
IPin_Disconnect(pConnectedTo);
|
||||
IPin_Release(pConnectedTo);
|
||||
}
|
||||
IPin_Disconnect(This->pOutputPin);
|
||||
IPin_Release(This->pOutputPin);
|
||||
}
|
||||
CoTaskMemFree(This->pszFileName);
|
||||
if (This->pmt)
|
||||
DeleteMediaType(This->pmt);
|
||||
strmbase_filter_cleanup(&This->filter);
|
||||
CoTaskMemFree(This);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return refCount;
|
||||
}
|
||||
|
||||
/** IMediaFilter methods **/
|
||||
|
||||
static HRESULT WINAPI AsyncReader_Stop(IBaseFilter * iface)
|
||||
|
@ -538,7 +531,7 @@ static const IBaseFilterVtbl AsyncReader_Vtbl =
|
|||
{
|
||||
AsyncReader_QueryInterface,
|
||||
BaseFilterImpl_AddRef,
|
||||
AsyncReader_Release,
|
||||
BaseFilterImpl_Release,
|
||||
BaseFilterImpl_GetClassID,
|
||||
AsyncReader_Stop,
|
||||
AsyncReader_Pause,
|
||||
|
|
Loading…
Reference in New Issue