From 84bede2b0d185c1cb0c32084a35b3ba026e268ad Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Sun, 16 Feb 2020 23:31:51 -0600 Subject: [PATCH] strmbase: Don't treat GUID_NULL in enumerated types as a wildcard. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/qedit/tests/samplegrabber.c | 21 +++------------------ dlls/quartz/tests/filesource.c | 21 +++------------------ dlls/strmbase/pin.c | 19 ++++++++----------- 3 files changed, 14 insertions(+), 47 deletions(-) diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index b3f325dd051..06db9d740e6 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -978,32 +978,17 @@ static void test_connect_pin(void) req_mt.majortype = MEDIATYPE_Video; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); - todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); - if (hr == S_OK) - { - IFilterGraph2_Disconnect(graph, source); - IFilterGraph2_Disconnect(graph, &testsink.sink.pin.IPin_iface); - } + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); req_mt.majortype = GUID_NULL; req_mt.subtype = MEDIASUBTYPE_RGB8; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); - todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); - if (hr == S_OK) - { - IFilterGraph2_Disconnect(graph, source); - IFilterGraph2_Disconnect(graph, &testsink.sink.pin.IPin_iface); - } + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); req_mt.subtype = GUID_NULL; req_mt.formattype = FORMAT_None; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, &req_mt); - todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); - if (hr == S_OK) - { - IFilterGraph2_Disconnect(graph, source); - IFilterGraph2_Disconnect(graph, &testsink.sink.pin.IPin_iface); - } + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); req_mt.formattype = GUID_NULL; testsink.sink_mt = &req_mt; diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c index 067d7d463c0..846b92ac60b 100644 --- a/dlls/quartz/tests/filesource.c +++ b/dlls/quartz/tests/filesource.c @@ -1405,12 +1405,7 @@ static void test_connect_pin(void) req_mt.formattype = FORMAT_None; req_mt.majortype = GUID_NULL; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); - todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); - if (hr == S_OK) - { - IFilterGraph2_Disconnect(graph, source); - IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface); - } + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); req_mt.formattype = GUID_NULL; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); @@ -1421,12 +1416,7 @@ static void test_connect_pin(void) req_mt.subtype = MEDIASUBTYPE_RGB8; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); - todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); - if (hr == S_OK) - { - IFilterGraph2_Disconnect(graph, source); - IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface); - } + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); req_mt.subtype = GUID_NULL; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); @@ -1438,12 +1428,7 @@ static void test_connect_pin(void) req_mt.majortype = MEDIATYPE_Stream; req_mt.subtype = MEDIASUBTYPE_RGB8; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); - todo_wine ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); - if (hr == S_OK) - { - IFilterGraph2_Disconnect(graph, source); - IFilterGraph2_Disconnect(graph, &testsink.pin.pin.IPin_iface); - } + ok(hr == VFW_E_NO_ACCEPTABLE_TYPES, "Got hr %#x.\n", hr); req_mt.subtype = GUID_NULL; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.pin.pin.IPin_iface, &req_mt); diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 844619b8fd9..17cb5d34b30 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -422,24 +422,21 @@ static inline struct strmbase_source *impl_source_from_IPin( IPin *iface ) return CONTAINING_RECORD(iface, struct strmbase_source, pin.IPin_iface); } -static BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b) +static BOOL compare_media_types(const AM_MEDIA_TYPE *req_mt, const AM_MEDIA_TYPE *pin_mt) { - if (!a) + if (!req_mt) return TRUE; - if (!IsEqualGUID(&a->majortype, &b->majortype) - && !IsEqualGUID(&a->majortype, &GUID_NULL) - && !IsEqualGUID(&b->majortype, &GUID_NULL)) + if (!IsEqualGUID(&req_mt->majortype, &pin_mt->majortype) + && !IsEqualGUID(&req_mt->majortype, &GUID_NULL)) return FALSE; - if (!IsEqualGUID(&a->subtype, &b->subtype) - && !IsEqualGUID(&a->subtype, &GUID_NULL) - && !IsEqualGUID(&b->subtype, &GUID_NULL)) + if (!IsEqualGUID(&req_mt->subtype, &pin_mt->subtype) + && !IsEqualGUID(&req_mt->subtype, &GUID_NULL)) return FALSE; - if (!IsEqualGUID(&a->formattype, &b->formattype) - && !IsEqualGUID(&a->formattype, &GUID_NULL) - && !IsEqualGUID(&b->formattype, &GUID_NULL)) + if (!IsEqualGUID(&req_mt->formattype, &pin_mt->formattype) + && !IsEqualGUID(&req_mt->formattype, &GUID_NULL)) return FALSE; return TRUE;