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

strmbase/transform: Use BaseFilterImpl_Release().

parent 61b5f780
......@@ -139,8 +139,38 @@ static IPin *transform_get_pin(BaseFilter *iface, unsigned int index)
return filter->ppPins[index];
}
static void transform_destroy(BaseFilter *iface)
{
TransformFilter *filter = impl_from_BaseFilter(iface);
ULONG i;
for (i = 0; i < 2; ++i)
{
IPin *peer;
if (SUCCEEDED(IPin_ConnectedTo(filter->ppPins[i], &peer)))
{
IPin_Disconnect(peer);
IPin_Release(peer);
}
IPin_Disconnect(filter->ppPins[i]);
IPin_Release(filter->ppPins[i]);
}
CoTaskMemFree(filter->ppPins);
filter->csReceive.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&filter->csReceive);
FreeMediaType(&filter->pmt);
QualityControlImpl_Destroy(filter->qcimpl);
IUnknown_Release(filter->seekthru_unk);
strmbase_filter_cleanup(&filter->filter);
CoTaskMemFree(filter);
}
static const BaseFilterFuncTable tfBaseFuncTable = {
.filter_get_pin = transform_get_pin,
.filter_destroy = transform_destroy,
};
static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = {
......@@ -161,45 +191,6 @@ static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable = {
BaseOutputPinImpl_DecideAllocator,
};
static ULONG WINAPI TransformFilterImpl_Release(IBaseFilter * iface)
{
TransformFilter *This = impl_from_IBaseFilter(iface);
ULONG refCount = InterlockedDecrement(&This->filter.refCount);
TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
if (!refCount)
{
ULONG i;
for (i = 0; i < 2; i++)
{
IPin *pConnectedTo;
if (SUCCEEDED(IPin_ConnectedTo(This->ppPins[i], &pConnectedTo)))
{
IPin_Disconnect(pConnectedTo);
IPin_Release(pConnectedTo);
}
IPin_Disconnect(This->ppPins[i]);
IPin_Release(This->ppPins[i]);
}
CoTaskMemFree(This->ppPins);
TRACE("Destroying transform filter\n");
This->csReceive.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&This->csReceive);
FreeMediaType(&This->pmt);
QualityControlImpl_Destroy(This->qcimpl);
IUnknown_Release(This->seekthru_unk);
strmbase_filter_cleanup(&This->filter);
CoTaskMemFree(This);
}
return refCount;
}
static HRESULT WINAPI TransformFilterImpl_Stop(IBaseFilter *iface)
{
TransformFilter *This = impl_from_IBaseFilter(iface);
......@@ -275,7 +266,7 @@ static const IBaseFilterVtbl transform_vtbl =
{
BaseFilterImpl_QueryInterface,
BaseFilterImpl_AddRef,
TransformFilterImpl_Release,
BaseFilterImpl_Release,
BaseFilterImpl_GetClassID,
TransformFilterImpl_Stop,
TransformFilterImpl_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