Commit b9735fc6 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/filesource: Use BaseFilterImpl_Release().

parent 3c98e11b
...@@ -403,8 +403,32 @@ static IPin *async_reader_get_pin(BaseFilter *iface, unsigned int index) ...@@ -403,8 +403,32 @@ static IPin *async_reader_get_pin(BaseFilter *iface, unsigned int index)
return This->pOutputPin; 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_get_pin = async_reader_get_pin,
.filter_destroy = async_reader_destroy,
}; };
HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv) HRESULT AsyncReader_create(IUnknown * pUnkOuter, LPVOID * ppv)
...@@ -468,37 +492,6 @@ static HRESULT WINAPI AsyncReader_QueryInterface(IBaseFilter * iface, REFIID rii ...@@ -468,37 +492,6 @@ static HRESULT WINAPI AsyncReader_QueryInterface(IBaseFilter * iface, REFIID rii
return E_NOINTERFACE; 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 **/ /** IMediaFilter methods **/
static HRESULT WINAPI AsyncReader_Stop(IBaseFilter * iface) static HRESULT WINAPI AsyncReader_Stop(IBaseFilter * iface)
...@@ -538,7 +531,7 @@ static const IBaseFilterVtbl AsyncReader_Vtbl = ...@@ -538,7 +531,7 @@ static const IBaseFilterVtbl AsyncReader_Vtbl =
{ {
AsyncReader_QueryInterface, AsyncReader_QueryInterface,
BaseFilterImpl_AddRef, BaseFilterImpl_AddRef,
AsyncReader_Release, BaseFilterImpl_Release,
BaseFilterImpl_GetClassID, BaseFilterImpl_GetClassID,
AsyncReader_Stop, AsyncReader_Stop,
AsyncReader_Pause, AsyncReader_Pause,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment