From: Brendan McGrath <bmcgrath@codeweavers.com> --- dlls/amstream/ddrawstream.c | 21 +++++++++++++++++---- dlls/amstream/tests/amstream.c | 1 - 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index fb17ff9a9c7..f33656aa130 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -1276,12 +1276,25 @@ static HRESULT WINAPI ddraw_sink_QueryId(IPin *iface, WCHAR **id) static HRESULT WINAPI ddraw_sink_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mt) { + struct ddraw_stream *stream = impl_from_IPin(iface); + TRACE("iface %p, mt %p.\n", iface, mt); - if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Video) - && IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB8) - && IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo) - && ((VIDEOINFOHEADER *)mt->pbFormat)->bmiHeader.biHeight >= 0) + if (!IsEqualGUID(&mt->majortype, &MEDIATYPE_Video) + || !IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo) + || ((VIDEOINFOHEADER *)mt->pbFormat)->bmiHeader.biHeight < 0) + return VFW_E_TYPE_NOT_ACCEPTED; + + if (IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB8)) + return S_OK; + + if (!stream->peer) + return VFW_E_TYPE_NOT_ACCEPTED; + + if (IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB555) + || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB565) + || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB24) + || IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB32)) return S_OK; return VFW_E_TYPE_NOT_ACCEPTED; diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 22bc00c1168..f21d3ad87d7 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -3153,7 +3153,6 @@ static void test_media_types(void) { mt.subtype = *rejected_subtypes[j]; hr = IPin_QueryAccept(pin, &mt); - todo_wine_if(j < 4) ok(hr == (j < 4 ? S_OK : VFW_E_TYPE_NOT_ACCEPTED), "Got hr %#lx for subtype %s whilst connected.\n", hr, wine_dbgstr_guid(rejected_subtypes[j])); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10643