Commit 5741789d authored by Laurent Aimar's avatar Laurent Aimar

Allowed vout_display_DeleteWindow(vd, NULL) to destroy unused window.

parent c75fafe4
......@@ -389,6 +389,10 @@ static inline vout_window_t *vout_display_NewWindow(vout_display_t *vd, const vo
{
return vd->owner.window_new(vd, cfg);
}
/**
* Deletes a window created by vout_display_NewWindow if window is non NULL
* or any unused windows otherwise.
*/
static inline void vout_display_DeleteWindow(vout_display_t *vd,
vout_window_t *window)
{
......
......@@ -504,10 +504,15 @@ void vout_DeleteDisplayWindow(vout_thread_t *vout, vout_display_t *vd,
vout_window_t *window)
{
VLC_UNUSED(vd);
if (!vout->p->window.is_unused && vout->p->window.object == window)
if (!vout->p->window.is_unused && vout->p->window.object == window) {
vout->p->window.is_unused = true;
else
} else if (vout->p->window.is_unused && vout->p->window.object && !window) {
vout_window_Delete(vout->p->window.object);
vout->p->window.is_unused = true;
vout->p->window.object = NULL;
} else if (window) {
vout_window_Delete(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