quartz: Make Parser_OutputPin_BreakConnect() a local helper.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-05-11 14:46:18 -05:00 committed by Alexandre Julliard
parent ce1c0ff1e9
commit f789c70ddd
1 changed files with 18 additions and 23 deletions

View File

@ -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_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_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_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc);
static HRESULT WINAPI Parser_OutputPin_BreakConnect(BaseOutputPin *This);
static inline ParserImpl *impl_from_IMediaSeeking( IMediaSeeking *iface ) static inline ParserImpl *impl_from_IMediaSeeking( IMediaSeeking *iface )
{ {
@ -429,7 +428,7 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = {
BaseOutputPinImpl_AttemptConnection, BaseOutputPinImpl_AttemptConnection,
Parser_OutputPin_DecideBufferSize, Parser_OutputPin_DecideBufferSize,
Parser_OutputPin_DecideAllocator, Parser_OutputPin_DecideAllocator,
Parser_OutputPin_BreakConnect NULL,
}; };
HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PROPERTIES * props, const AM_MEDIA_TYPE * amt) 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; 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) static HRESULT Parser_RemoveOutputPins(ParserImpl * This)
{ {
/* NOTE: should be in critical section when calling this function */ /* 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++) 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); TRACE("Disconnect: %08x\n", hr);
IPin_Release(ppOldPins[i + 1]); IPin_Release(ppOldPins[i + 1]);
} }
@ -609,26 +624,6 @@ static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *iface, IMe
return hr; 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) static HRESULT WINAPI Parser_OutputPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv)
{ {
Parser_OutputPin *This = unsafe_impl_Parser_OutputPin_from_IPin(iface); Parser_OutputPin *This = unsafe_impl_Parser_OutputPin_from_IPin(iface);