Commit 6bae19b4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

display: pull window type checking

parent 3cce1e76
......@@ -638,9 +638,14 @@ static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
static vout_window_t *VoutDisplayNewWindow(vout_display_t *vd, unsigned type)
{
vout_display_owner_sys_t *osys = vd->owner.sys;
vout_window_t *window = vout_NewDisplayWindow(osys->vout, type);
if (window != NULL)
vout_display_window_Attach(window, vd);
vout_window_t *window = vout_NewDisplayWindow(osys->vout);
if (window == NULL)
return NULL;
if (type != VOUT_WINDOW_TYPE_INVALID && type != window->type)
return NULL;
vout_display_window_Attach(window, vd);
return window;
}
......
......@@ -33,7 +33,7 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
/* FIXME should not be there */
void vout_SendDisplayEventMouse(vout_thread_t *, const vlc_mouse_t *);
vout_window_t *vout_NewDisplayWindow(vout_thread_t *, unsigned type);
vout_window_t *vout_NewDisplayWindow(vout_thread_t *);
void vout_DeleteDisplayWindow(vout_thread_t *, vout_window_t *);
void vout_SetDisplayWindowSize(vout_thread_t *, unsigned, unsigned);
......
......@@ -607,17 +607,10 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, cons
cfg->align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
}
vout_window_t *vout_NewDisplayWindow(vout_thread_t *vout, unsigned type)
vout_window_t *vout_NewDisplayWindow(vout_thread_t *vout)
{
vout_window_t *window = vout->p->window;
assert(vout->p->splitter_name == NULL);
if (window == NULL)
return NULL;
if (type != VOUT_WINDOW_TYPE_INVALID && type != window->type)
return NULL;
return window;
return vout->p->window;
}
void vout_DeleteDisplayWindow(vout_thread_t *vout, vout_window_t *window)
......
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