amstream: Return VFW_E_TYPE_NOT_ACCEPTED on error in AMVideoStream::QueryAccept().

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2020-06-30 19:57:15 -05:00 committed by Alexandre Julliard
parent ddcabfa2d7
commit 83bdfb780c
2 changed files with 6 additions and 5 deletions

View File

@ -798,7 +798,7 @@ static HRESULT WINAPI ddraw_sink_QueryId(IPin *iface, WCHAR **id)
static HRESULT WINAPI ddraw_sink_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mt)
{
TRACE("iface %p, mt %p.\n", iface, mt);
return check_media_type(mt) ? S_OK : S_FALSE;
return check_media_type(mt) ? S_OK : VFW_E_TYPE_NOT_ACCEPTED;
}
static HRESULT WINAPI ddraw_sink_EnumMediaTypes(IPin *iface, IEnumMediaTypes **enum_media_types)

View File

@ -1958,20 +1958,21 @@ static void test_media_types(void)
pmt->majortype = MEDIATYPE_NULL;
hr = IPin_QueryAccept(pin, pmt);
todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
pmt->majortype = MEDIATYPE_Audio;
hr = IPin_QueryAccept(pin, pmt);
todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
pmt->majortype = MEDIATYPE_Stream;
hr = IPin_QueryAccept(pin, pmt);
todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr);
pmt->majortype = MEDIATYPE_Video;
for (i = 0; i < ARRAY_SIZE(rejected_subtypes); ++i)
{
pmt->subtype = *rejected_subtypes[i];
hr = IPin_QueryAccept(pin, pmt);
todo_wine ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x for subtype %s.\n",
todo_wine_if (i < 6)
ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x for subtype %s.\n",
hr, wine_dbgstr_guid(rejected_subtypes[i]));
}