Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/strmbase/pin.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 297d04d261..6005b8a252 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -391,6 +391,13 @@ static HRESULT WINAPI pin_QueryId(IPin *iface, WCHAR **id) return S_OK; }
+static BOOL query_accept(struct strmbase_pin *pin, const AM_MEDIA_TYPE *mt) +{ + if (pin->ops->pin_query_accept && pin->ops->pin_query_accept(pin, mt) != S_OK) + return FALSE; + return TRUE; +} + static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mt) { struct strmbase_pin *pin = impl_from_IPin(iface); @@ -398,7 +405,7 @@ static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mt) TRACE("pin %p %s:%s, mt %p.\n", pin, debugstr_w(pin->filter->name), debugstr_w(pin->name), mt); strmbase_dump_media_type(mt);
- return (pin->ops->pin_query_accept(pin, mt) == S_OK ? S_OK : S_FALSE); + return query_accept(pin, mt) ? S_OK : S_FALSE; }
static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types) @@ -760,7 +767,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *This,
TRACE("(%p)->(%p, %p)\n", This, pReceivePin, pmt);
- if (This->pFuncsTable->base.pin_query_accept(&This->pin, pmt) != S_OK) + if (!query_accept(&This->pin, pmt)) return VFW_E_TYPE_NOT_ACCEPTED;
This->pin.peer = pReceivePin; @@ -868,7 +875,7 @@ static HRESULT WINAPI sink_ReceiveConnection(IPin *iface, IPin *pReceivePin, con if (This->pin.peer) hr = VFW_E_ALREADY_CONNECTED;
- if (SUCCEEDED(hr) && This->pin.ops->pin_query_accept(&This->pin, pmt) != S_OK) + if (SUCCEEDED(hr) && !query_accept(&This->pin, pmt)) hr = VFW_E_TYPE_NOT_ACCEPTED; /* FIXME: shouldn't we just map common errors onto * VFW_E_TYPE_NOT_ACCEPTED and pass the value on otherwise? */