From: Alfred Agrell <floating(a)muncher.se> --- dlls/quartz/vmr9.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index d26b6cd8fea..6efc626f6f6 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -514,9 +514,8 @@ static HRESULT vmr_connect(struct strmbase_renderer *iface, const AM_MEDIA_TYPE return hr; } -static void vmr_disconnect(struct strmbase_renderer *This) +static void deallocate_surfaces(struct quartz_vmr *filter) { - struct quartz_vmr *filter = impl_from_IBaseFilter(&This->filter.IBaseFilter_iface); DWORD i; if (filter->mode && filter->allocator && filter->presenter) @@ -530,6 +529,12 @@ static void vmr_disconnect(struct strmbase_renderer *This) } } +static void vmr_disconnect(struct strmbase_renderer *This) +{ + struct quartz_vmr *filter = impl_from_IBaseFilter(&This->filter.IBaseFilter_iface); + deallocate_surfaces(filter); +} + static void vmr_destroy(struct strmbase_renderer *iface) { struct quartz_vmr *filter = impl_from_IBaseFilter(&iface->filter.IBaseFilter_iface); @@ -1999,16 +2004,24 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice(IVMRSurfaceAllocat return S_OK; } -static HRESULT WINAPI VMR9SurfaceAllocatorNotify_ChangeD3DDevice(IVMRSurfaceAllocatorNotify9 *iface, IDirect3DDevice9 *device, HMONITOR monitor) +static HRESULT WINAPI VMR9SurfaceAllocatorNotify_ChangeD3DDevice(IVMRSurfaceAllocatorNotify9 *iface, + IDirect3DDevice9 *device, HMONITOR monitor) { struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); - FIXME("(%p/%p)->(...) semi-stub\n", iface, This); + TRACE("(%p/%p)->(...).\n", iface, This); + if (This->allocator_d3d9_dev) IDirect3DDevice9_Release(This->allocator_d3d9_dev); This->allocator_d3d9_dev = device; IDirect3DDevice9_AddRef(This->allocator_d3d9_dev); + if (This->mode && This->allocator && This->presenter) + { + deallocate_surfaces(This); + allocate_surfaces(This, &This->renderer.sink.pin.mt); + } + return S_OK; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3792