diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 9278a58bf7e..d92161f1c2c 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -46,7 +46,6 @@ static HRESULT WINAPI Parser_OutputPin_DecideBufferSize(BaseOutputPin *iface, IM static HRESULT WINAPI Parser_OutputPin_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt); static HRESULT WINAPI Parser_OutputPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_TYPE *pmt); static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); -static HRESULT WINAPI Parser_OutputPin_BreakConnect(BaseOutputPin *This); static inline ParserImpl *impl_from_IMediaSeeking( IMediaSeeking *iface ) { @@ -429,7 +428,7 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, Parser_OutputPin_DecideBufferSize, Parser_OutputPin_DecideAllocator, - Parser_OutputPin_BreakConnect + NULL, }; HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PROPERTIES * props, const AM_MEDIA_TYPE * amt) @@ -468,6 +467,22 @@ HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PR return hr; } +static HRESULT WINAPI break_connection(IPin *iface) +{ + Parser_OutputPin *pin = unsafe_impl_Parser_OutputPin_from_IPin(iface); + HRESULT hr; + + if (!pin->pin.pin.pConnectedTo || !pin->pin.pMemInputPin) + hr = VFW_E_NOT_CONNECTED; + else + { + hr = IPin_Disconnect(pin->pin.pin.pConnectedTo); + IPin_Disconnect(iface); + } + + return hr; +} + static HRESULT Parser_RemoveOutputPins(ParserImpl * This) { /* NOTE: should be in critical section when calling this function */ @@ -483,7 +498,7 @@ static HRESULT Parser_RemoveOutputPins(ParserImpl * This) for (i = 0; i < This->cStreams; i++) { - hr = ((BaseOutputPin *)ppOldPins[i + 1])->pFuncsTable->pfnBreakConnect((BaseOutputPin *)ppOldPins[i + 1]); + hr = break_connection(ppOldPins[i + 1]); TRACE("Disconnect: %08x\n", hr); IPin_Release(ppOldPins[i + 1]); } @@ -609,26 +624,6 @@ static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *iface, IMe return hr; } -static HRESULT WINAPI Parser_OutputPin_BreakConnect(BaseOutputPin *This) -{ - HRESULT hr; - - TRACE("(%p)->()\n", This); - - EnterCriticalSection(This->pin.pCritSec); - if (!This->pin.pConnectedTo || !This->pMemInputPin) - hr = VFW_E_NOT_CONNECTED; - else - { - hr = IPin_Disconnect(This->pin.pConnectedTo); - IPin_Disconnect(&This->pin.IPin_iface); - } - LeaveCriticalSection(This->pin.pCritSec); - - return hr; -} - - static HRESULT WINAPI Parser_OutputPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) { Parser_OutputPin *This = unsafe_impl_Parser_OutputPin_from_IPin(iface);