Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50668 Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/qcap/tests/smartteefilter.c | 2 +- dlls/qedit/tests/samplegrabber.c | 4 ++-- dlls/quartz/tests/avidec.c | 2 +- dlls/quartz/tests/avisplit.c | 2 +- libs/strmbase/pin.c | 32 ++++++++++++++++---------------- 5 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/dlls/qcap/tests/smartteefilter.c b/dlls/qcap/tests/smartteefilter.c index c8a66f1370a..b6ba3ca75c9 100644 --- a/dlls/qcap/tests/smartteefilter.c +++ b/dlls/qcap/tests/smartteefilter.c @@ -1095,7 +1095,7 @@ static void test_source_connection(AM_MEDIA_TYPE req_mt, IFilterGraph2 *graph, req_mt.lSampleSize = 3; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink->sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink->sink.pin.mt, &req_mt), "Media types didn't match.\n"); IFilterGraph2_Disconnect(graph, source); IFilterGraph2_Disconnect(graph, &testsink->sink.pin.IPin_iface);
diff --git a/dlls/qedit/tests/samplegrabber.c b/dlls/qedit/tests/samplegrabber.c index 4c930e0c87a..13ec04cdc1c 100644 --- a/dlls/qedit/tests/samplegrabber.c +++ b/dlls/qedit/tests/samplegrabber.c @@ -1260,8 +1260,8 @@ static void test_connect_pin(void) req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); - ok(compare_media_types(&testsource.source.pin.mt, &testsource.source_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsource.source.pin.mt, &testsink.sink.pin.mt), "Media types didn't match.\n");
hr = IPin_EnumMediaTypes(sink, &enummt); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/avidec.c b/dlls/quartz/tests/avidec.c index 10aa9711982..ac1078bf59b 100644 --- a/dlls/quartz/tests/avidec.c +++ b/dlls/quartz/tests/avidec.c @@ -1516,7 +1516,7 @@ static void test_connect_pin(void) req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
hr = IFilterGraph2_Disconnect(graph, sink); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/tests/avisplit.c b/dlls/quartz/tests/avisplit.c index 47f20b70d61..06c2f5fed3c 100644 --- a/dlls/quartz/tests/avisplit.c +++ b/dlls/quartz/tests/avisplit.c @@ -1365,7 +1365,7 @@ static void test_connect_pin(void) req_mt.lSampleSize = 444; hr = IFilterGraph2_ConnectDirect(graph, source, &testsink.sink.pin.IPin_iface, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n"); + ok(compare_media_types(&testsink.sink.pin.mt, &req_mt), "Media types didn't match.\n");
IPin_Release(source); hr = IFilterGraph2_Disconnect(graph, sink); diff --git a/libs/strmbase/pin.c b/libs/strmbase/pin.c index efce0155a9e..36b3fdf1425 100644 --- a/libs/strmbase/pin.c +++ b/libs/strmbase/pin.c @@ -516,22 +516,6 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP return hr; }
- if (pin->pFuncsTable->base.pin_get_media_type) - { - for (i = 0; pin->pFuncsTable->base.pin_get_media_type(&pin->pin, i, &candidate) == S_OK; ++i) - { - strmbase_dump_media_type(&candidate); - if (compare_media_types(mt, &candidate) - && pin->pFuncsTable->pfnAttemptConnection(pin, peer, &candidate) == S_OK) - { - LeaveCriticalSection(&pin->pin.filter->filter_cs); - FreeMediaType(&candidate); - return S_OK; - } - FreeMediaType(&candidate); - } - } - if (SUCCEEDED(IPin_EnumMediaTypes(peer, &enummt))) { while (IEnumMediaTypes_Next(enummt, 1, &candidate_ptr, &count) == S_OK) @@ -550,6 +534,22 @@ static HRESULT WINAPI source_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYP IEnumMediaTypes_Release(enummt); }
+ if (pin->pFuncsTable->base.pin_get_media_type) + { + for (i = 0; pin->pFuncsTable->base.pin_get_media_type(&pin->pin, i, &candidate) == S_OK; ++i) + { + strmbase_dump_media_type(&candidate); + if (compare_media_types(mt, &candidate) + && pin->pFuncsTable->pfnAttemptConnection(pin, peer, &candidate) == S_OK) + { + LeaveCriticalSection(&pin->pin.filter->filter_cs); + FreeMediaType(&candidate); + return S_OK; + } + FreeMediaType(&candidate); + } + } + LeaveCriticalSection(&pin->pin.filter->filter_cs);
return VFW_E_NO_ACCEPTABLE_TYPES;