Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/videorenderer.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 87365d9212..f4d6945380 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -82,21 +82,6 @@ static inline VideoRendererImpl *impl_from_BaseControlVideo(BaseControlVideo *if return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlVideo); }
-static BOOL CreateRenderingSubsystem(VideoRendererImpl* This) -{ - This->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); - if (!This->hEvent) - return FALSE; - - if (FAILED(BaseWindowImpl_PrepareWindow(&This->baseControlWindow.baseWindow))) - { - CloseHandle(This->hEvent); - return FALSE; - } - - return TRUE; -} - static void VideoRenderer_AutoShowWindow(VideoRendererImpl *This) { if (!This->init && (!This->WindowPos.right || !This->WindowPos.top)) @@ -873,8 +858,11 @@ HRESULT VideoRenderer_create(IUnknown *outer, void **out) if (FAILED(hr)) goto fail;
- if (!CreateRenderingSubsystem(pVideoRenderer)) { - hr = E_FAIL; + pVideoRenderer->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + + if (FAILED(BaseWindowImpl_PrepareWindow(&pVideoRenderer->baseControlWindow.baseWindow))) + { + CloseHandle(pVideoRenderer->hEvent); goto fail; }
We don't use a lock, and while it's true we probably should be, we already have access to one.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/videorenderer.c | 6 +++--- dlls/quartz/vmr9.c | 5 ++--- dlls/strmbase/window.c | 5 ++--- include/wine/strmbase.h | 5 ++--- 4 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index f4d6945380..f3b2afe6fb 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -846,9 +846,9 @@ HRESULT VideoRenderer_create(IUnknown *outer, void **out) if (FAILED(hr)) goto fail;
- hr = BaseControlWindow_Init(&pVideoRenderer->baseControlWindow, &IVideoWindow_VTable, - &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter, - &pVideoRenderer->renderer.sink.pin, &renderer_BaseWindowFuncTable); + hr = strmbase_window_init(&pVideoRenderer->baseControlWindow, &IVideoWindow_VTable, + &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.sink.pin, + &renderer_BaseWindowFuncTable); if (FAILED(hr)) goto fail;
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 59a5152cf5..c3b948f599 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -2251,9 +2251,8 @@ static HRESULT vmr_create(IUnknown *outer, void **out, const CLSID *clsid) if (FAILED(hr)) goto fail;
- hr = BaseControlWindow_Init(&pVMR->baseControlWindow, &IVideoWindow_VTable, - &pVMR->renderer.filter, &pVMR->renderer.filter.csFilter, - &pVMR->renderer.sink.pin, &renderer_BaseWindowFuncTable); + hr = strmbase_window_init(&pVMR->baseControlWindow, &IVideoWindow_VTable, + &pVMR->renderer.filter, &pVMR->renderer.sink.pin, &renderer_BaseWindowFuncTable); if (FAILED(hr)) goto fail;
diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index 23f37de52b..be6646c27a 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -144,9 +144,9 @@ HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This) return S_OK; }
-HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, +HRESULT WINAPI strmbase_window_init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, struct strmbase_filter *owner, - CRITICAL_SECTION *lock, struct strmbase_pin *pPin, const BaseWindowFuncTable *pFuncsTable) + struct strmbase_pin *pPin, const BaseWindowFuncTable *pFuncsTable) { HRESULT hr;
@@ -158,7 +158,6 @@ HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, pControlWindow->hwndDrain = NULL; pControlWindow->hwndOwner = NULL; pControlWindow->pFilter = owner; - pControlWindow->pInterfaceLock = lock; pControlWindow->pPin = pPin; } return hr; diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index 5be7caa371..74c8f4721b 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -403,12 +403,11 @@ typedef struct tagBaseControlWindow HWND hwndDrain; HWND hwndOwner; struct strmbase_filter *pFilter; - CRITICAL_SECTION* pInterfaceLock; struct strmbase_pin *pPin; } BaseControlWindow;
-HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *window, const IVideoWindowVtbl *vtbl, - struct strmbase_filter *filter, CRITICAL_SECTION *lock, struct strmbase_pin *pin, const BaseWindowFuncTable *ops); +HRESULT WINAPI strmbase_window_init(BaseControlWindow *window, const IVideoWindowVtbl *vtbl, + struct strmbase_filter *filter, struct strmbase_pin *pin, const BaseWindowFuncTable *func_table); HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow);
BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=57949
Your paranoid android.
=== debian10 (32 bit report) ===
quartz: systemclock.c:92: Test failed: Expected about 31240031b0, but got 31240031b0.
October 17, 2019 11:17 PM, "Zebediah Figura" z.figura12@gmail.com wrote:
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 87365d9212..f4d6945380 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -873,8 +858,11 @@ HRESULT VideoRenderer_create(IUnknown *outer, void **out) if (FAILED(hr)) goto fail;
- if (!CreateRenderingSubsystem(pVideoRenderer)) {
hr = E_FAIL;
- pVideoRenderer->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
- if (FAILED(BaseWindowImpl_PrepareWindow(&pVideoRenderer->baseControlWindow.baseWindow)))
I think you want to set 'hr' here.
- {
}CloseHandle(pVideoRenderer->hEvent); goto fail;
-- 2.23.0
Chip
On 10/18/2019 12:34 AM, Chip Davis wrote:
October 17, 2019 11:17 PM, "Zebediah Figura" z.figura12@gmail.com wrote:
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 87365d9212..f4d6945380 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -873,8 +858,11 @@ HRESULT VideoRenderer_create(IUnknown *outer, void **out) if (FAILED(hr)) goto fail;
- if (!CreateRenderingSubsystem(pVideoRenderer)) {
hr = E_FAIL;
- pVideoRenderer->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
- if (FAILED(BaseWindowImpl_PrepareWindow(&pVideoRenderer->baseControlWindow.baseWindow)))
I think you want to set 'hr' here.
I consciously didn't so as to preserve the current behaviour, but it is better that way. I'll send an updated patch.
- {
}CloseHandle(pVideoRenderer->hEvent); goto fail;
-- 2.23.0
Chip