Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/quartz_private.h | 2 +- dlls/quartz/videorenderer.c | 17 +++++++---------- dlls/quartz/vmr9.c | 20 +++++++++----------- dlls/quartz/window.c | 3 +-- 4 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/dlls/quartz/quartz_private.h b/dlls/quartz/quartz_private.h index 3274714eea1..b0fb91c665a 100644 --- a/dlls/quartz/quartz_private.h +++ b/dlls/quartz/quartz_private.h @@ -111,7 +111,7 @@ struct video_window_ops
void video_window_cleanup(struct video_window *window) DECLSPEC_HIDDEN; HRESULT video_window_create_window(struct video_window *window) DECLSPEC_HIDDEN; -HRESULT video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl, +void video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl, struct strmbase_filter *filter, struct strmbase_pin *pin, const struct video_window_ops *ops) DECLSPEC_HIDDEN; void video_window_unregister_class(void) DECLSPEC_HIDDEN;
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index 3888d010e6e..54a646fbc04 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -714,27 +714,24 @@ HRESULT video_renderer_create(IUnknown *outer, IUnknown **out) strmbase_renderer_init(&object->renderer, outer, &CLSID_VideoRenderer, L"In", &renderer_ops); object->IOverlay_iface.lpVtbl = &overlay_vtbl;
- hr = video_window_init(&object->baseControlWindow, &IVideoWindow_VTable, + video_window_init(&object->baseControlWindow, &IVideoWindow_VTable, &object->renderer.filter, &object->renderer.sink.pin, &window_ops); - if (FAILED(hr)) - goto fail; - basic_video_init(&object->baseControlVideo, &object->renderer.filter, &object->renderer.sink.pin, &renderer_BaseControlVideoFuncTable);
if (FAILED(hr = video_window_create_window(&object->baseControlWindow))) - goto fail; + { + video_window_cleanup(&object->baseControlWindow); + strmbase_renderer_cleanup(&object->renderer); + free(object); + return hr; + }
object->run_event = CreateEventW(NULL, TRUE, FALSE, NULL);
TRACE("Created video renderer %p.\n", object); *out = &object->renderer.filter.IUnknown_inner; return S_OK; - -fail: - strmbase_renderer_cleanup(&object->renderer); - free(object); - return hr; }
HRESULT video_renderer_default_create(IUnknown *outer, IUnknown **out) diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index 82727adb870..389166db3ed 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -2318,13 +2318,17 @@ static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid) object->IVMRWindowlessControl9_iface.lpVtbl = &VMR9_WindowlessControl_Vtbl; object->IOverlay_iface.lpVtbl = &overlay_vtbl;
- hr = video_window_init(&object->baseControlWindow, &IVideoWindow_VTable, + video_window_init(&object->baseControlWindow, &IVideoWindow_VTable, &object->renderer.filter, &object->renderer.sink.pin, &window_ops); - if (FAILED(hr)) - goto fail;
if (FAILED(hr = video_window_create_window(&object->baseControlWindow))) - goto fail; + { + video_window_cleanup(&object->baseControlWindow); + strmbase_renderer_cleanup(&object->renderer); + FreeLibrary(object->hD3d9); + free(object); + return hr; + }
basic_video_init(&object->baseControlVideo, &object->renderer.filter, &object->renderer.sink.pin, &renderer_BaseControlVideoFuncTable); @@ -2333,13 +2337,7 @@ static HRESULT vmr_create(IUnknown *outer, IUnknown **out, const CLSID *clsid)
TRACE("Created VMR %p.\n", object); *out = &object->renderer.filter.IUnknown_inner; - return hr; - -fail: - strmbase_renderer_cleanup(&object->renderer); - FreeLibrary(object->hD3d9); - free(object); - return hr; + return S_OK; }
HRESULT vmr7_create(IUnknown *outer, IUnknown **out) diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 7e8aba8a263..61673cab048 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -662,7 +662,7 @@ void video_window_unregister_class(void) ERR("Failed to unregister class, error %u.\n", GetLastError()); }
-HRESULT video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl, +void video_window_init(struct video_window *window, const IVideoWindowVtbl *vtbl, struct strmbase_filter *owner, struct strmbase_pin *pin, const struct video_window_ops *ops) { memset(window, 0, sizeof(*window)); @@ -671,7 +671,6 @@ HRESULT video_window_init(struct video_window *window, const IVideoWindowVtbl *v window->AutoShow = OATRUE; window->pFilter = owner; window->pPin = pin; - return S_OK; }
void video_window_cleanup(struct video_window *window)