Module: wine Branch: master Commit: 8be62e8e307728b38b3de2936f6adef84ae31404 URL: https://gitlab.winehq.org/wine/wine/-/commit/8be62e8e307728b38b3de2936f6adef...
Author: Zebediah Figura zfigura@codeweavers.com Date: Wed May 3 13:19:12 2023 -0500
quartz: Check whether the pin is connected in IVideoWindow::put_Visible().
Ferro CCTV calls this.
---
dlls/quartz/tests/videorenderer.c | 3 +++ dlls/quartz/tests/vmr7.c | 3 +++ dlls/quartz/tests/vmr9.c | 3 +++ dlls/quartz/window.c | 3 +++ 4 files changed, 12 insertions(+)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 76088534924..edc4d40f19d 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2402,6 +2402,9 @@ static void test_video_window(void) hr = IVideoWindow_put_MessageDrain(window, (OAHWND)our_hwnd); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
+ hr = IVideoWindow_put_Visible(window, OATRUE); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + testfilter_init(&source); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, filter, NULL); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 04bf7c1ba1b..7282458dc33 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2401,6 +2401,9 @@ static void test_video_window(void) hr = IVideoWindow_put_MessageDrain(window, (OAHWND)our_hwnd); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
+ hr = IVideoWindow_put_Visible(window, OATRUE); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + testfilter_init(&source); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, filter, NULL); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 299b0de22d5..c201d316bab 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2627,6 +2627,9 @@ static void test_video_window(void) hr = IVideoWindow_put_MessageDrain(window, (OAHWND)our_hwnd); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr);
+ hr = IVideoWindow_put_Visible(window, OATRUE); + ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#lx.\n", hr); + testfilter_init(&source); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, NULL); IFilterGraph2_AddFilter(graph, filter, NULL); diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 1b6d2664a10..130194bcc29 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -350,6 +350,9 @@ HRESULT WINAPI BaseControlWindowImpl_put_Visible(IVideoWindow *iface, LONG visib
TRACE("window %p, visible %ld.\n", window, visible);
+ if (!window->pPin->peer) + return VFW_E_NOT_CONNECTED; + ShowWindow(window->hwnd, visible ? SW_SHOW : SW_HIDE); return S_OK; }