Commit 9156e124 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

strmbase: Try sink types before source types.

parent c9addf8c
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment