[vlc-commits] display: pull window type checking
Rémi Denis-Courmont
git at videolan.org
Sun May 20 19:51:36 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 16 22:26:23 2018 +0300| [6bae19b4fb843bdc98d5a8fb98e28d97675c8762] | committer: Rémi Denis-Courmont
display: pull window type checking
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6bae19b4fb843bdc98d5a8fb98e28d97675c8762
---
src/video_output/display.c | 11 ++++++++---
src/video_output/display.h | 2 +-
src/video_output/video_output.c | 11 ++---------
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 871190c766..d601e34d77 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -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;
}
diff --git a/src/video_output/display.h b/src/video_output/display.h
index f1acf839cc..15c22d2f87 100644
--- a/src/video_output/display.h
+++ b/src/video_output/display.h
@@ -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);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index a40cdaed76..4e777e055f 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -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)
More information about the vlc-commits
mailing list