[vlc-commits] vout: simplify window allocation following splitter separation
Rémi Denis-Courmont
git at videolan.org
Thu Oct 16 19:25:58 CEST 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Oct 11 17:40:16 2014 +0300| [2ebff44437759dcd049880a39fcee8a6b0bc2092] | committer: Rémi Denis-Courmont
vout: simplify window allocation following splitter separation
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2ebff44437759dcd049880a39fcee8a6b0bc2092
---
src/video_output/video_output.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 23a0978..a0d2baa 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -614,16 +614,17 @@ vout_window_t * vout_NewDisplayWindow(vout_thread_t *vout,
{
vout_window_cfg_t cfg_override = *cfg;
+ assert(vout->p->splitter_name == NULL);
if (!var_InheritBool( vout, "embedded-video"))
cfg_override.is_standalone = true;
- if (vout->p->window.is_unused && vout->p->window.object) {
- assert(!vout->p->splitter_name);
+ vout_window_t *window = vout->p->window.object;
+
+ if (vout->p->window.is_unused && window != NULL) {
if (!cfg_override.is_standalone == !vout->p->window.cfg.is_standalone &&
cfg_override.type == vout->p->window.cfg.type) {
/* Reuse the stored window */
msg_Dbg(vout, "Reusing previous vout window");
- vout_window_t *window = vout->p->window.object;
if (cfg_override.width != vout->p->window.cfg.width ||
cfg_override.height != vout->p->window.cfg.height)
vout_window_SetSize(window,
@@ -633,16 +634,13 @@ vout_window_t * vout_NewDisplayWindow(vout_thread_t *vout,
return window;
}
- vout_window_Delete(vout->p->window.object);
+ vout_window_Delete(window);
vout->p->window.is_unused = true;
vout->p->window.object = NULL;
}
- vout_window_t *window = vout_window_New(VLC_OBJECT(vout), "$window",
- &cfg_override);
- if (!window)
- return NULL;
- if (!vout->p->splitter_name) {
+ window = vout_window_New(VLC_OBJECT(vout), "$window", &cfg_override);
+ if (window != NULL) {
vout->p->window.is_unused = false;
vout->p->window.cfg = cfg_override;
vout->p->window.object = window;
More information about the vlc-commits
mailing list