Commit 20b1ef6e authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz: Return the rect from get_default_rect() through a pointer.

Notably, this avoids the incorrect use of a static variable.
parent bc1ba439
......@@ -108,7 +108,7 @@ struct video_window
struct video_window_ops
{
RECT (*get_default_rect)(struct video_window *window);
void (*get_default_rect)(struct video_window *window, RECT *rect);
HRESULT (*get_current_image)(struct video_window *window, LONG *size, LONG *image);
};
......
......@@ -199,14 +199,11 @@ static HRESULT video_renderer_connect(struct strmbase_renderer *iface, const AM_
return S_OK;
}
static RECT video_renderer_get_default_rect(struct video_window *iface)
static void video_renderer_get_default_rect(struct video_window *iface, RECT *rect)
{
struct video_renderer *This = impl_from_video_window(iface);
static RECT defRect;
SetRect(&defRect, 0, 0, This->VideoWidth, This->VideoHeight);
struct video_renderer *filter = impl_from_video_window(iface);
return defRect;
SetRect(rect, 0, 0, filter->VideoWidth, filter->VideoHeight);
}
static const struct strmbase_renderer_ops renderer_ops =
......
......@@ -642,15 +642,12 @@ static const struct strmbase_renderer_ops renderer_ops =
.renderer_pin_query_interface = vmr_pin_query_interface,
};
static RECT vmr_get_default_rect(struct video_window *This)
static void vmr_get_default_rect(struct video_window *iface, RECT *rect)
{
struct quartz_vmr *pVMR9 = impl_from_video_window(This);
const BITMAPINFOHEADER *bmiheader = get_filter_bitmap_header(pVMR9);
static RECT defRect;
SetRect(&defRect, 0, 0, bmiheader->biWidth, bmiheader->biHeight);
struct quartz_vmr *filter = impl_from_video_window(iface);
const BITMAPINFOHEADER *bitmap_header = get_filter_bitmap_header(filter);
return defRect;
SetRect(rect, 0, 0, bitmap_header->biWidth, bitmap_header->biHeight);
}
static HRESULT vmr_get_current_image(struct video_window *iface, LONG *size, LONG *image)
......
......@@ -655,7 +655,7 @@ HRESULT WINAPI BaseControlWindowImpl_GetMinIdealImageSize(IVideoWindow *iface, L
TRACE("window %p, width %p, height %p.\n", window, width, height);
rect = window->ops->get_default_rect(window);
window->ops->get_default_rect(window, &rect);
*width = rect.right - rect.left;
*height = rect.bottom - rect.top;
return S_OK;
......@@ -668,7 +668,7 @@ HRESULT WINAPI BaseControlWindowImpl_GetMaxIdealImageSize(IVideoWindow *iface, L
TRACE("window %p, width %p, height %p.\n", window, width, height);
rect = window->ops->get_default_rect(window);
window->ops->get_default_rect(window, &rect);
*width = rect.right - rect.left;
*height = rect.bottom - rect.top;
return S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment