[vlc-devel] [PATCH] glwin32: configure the vlc_gt with the actual vout_window that is used

Steve Lhomme robux4 at ycbcr.xyz
Mon Feb 25 15:54:48 CET 2019


On 25/02/2019 15:31, Rémi Denis-Courmont wrote:
> Nit in title.
>
> But more importantly, I don't understand how it works if the display 
> is (supposed to be) embedded? If it creates its own window 
> unilaterally, then won't it always be non-embedded?

I also don't understand how it works. Maybe Thomas does.

The issue(s) I got were:
- that this window was created but not used => no display.
- the vout_window object was released in this module, assuming it's the 
one it created except it wasn't. The core was still making use of that 
vout_window => crash
- the window operations callback were set on the other vout_window that 
is not used (that's after the embedded one was released that the 
callbacks were crashing)

I think it makes sense to use the vout_window it allocated on purpose. 
Now why it needs that is a mystery to me. It doesn't work when using the 
one allocated from the core.

>
> Le 25 février 2019 13:01:12 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> 
> a écrit :
>
>     This way the matching vout_window_operations are used.
>
>     Fixes a crash when using OpenGL on windows.
>     ------------------------------------------------------------------------
>     Replaceshttps://patches.videolan.org/patch/22634/
>     ------------------------------------------------------------------------
>       modules/video_output/win32/glwin32.c | 11 ++++++-----
>       1 file changed, 6 insertions(+), 5 deletions(-)
>
>     diff --git a/modules/video_output/win32/glwin32.c b/modules/video_output/win32/glwin32.c
>     index e654455633..0c39fa721e 100644
>     --- a/modules/video_output/win32/glwin32.c
>     +++ b/modules/video_output/win32/glwin32.c
>     @@ -127,16 +127,17 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
>           if (!sys->sys.b_windowless)
>               EventThreadUpdateTitle(sys->sys.event, VOUT_TITLE " (OpenGL output)");
>       
>     -    vout_window_t *surface = EmbedVideoWindow_Create(vd);
>     -    if (!surface)
>     +    vout_display_cfg_t embed_cfg = *cfg;
>     +    embed_cfg.window = EmbedVideoWindow_Create(vd);
>     +    if (!embed_cfg.window)
>               goto error;
>       
>     -    char *modlist = var_InheritString(surface, "gl");
>     -    sys->gl = vlc_gl_Create(cfg, VLC_OPENGL, modlist);
>     +    char *modlist = var_InheritString(embed_cfg.window, "gl");
>     +    sys->gl = vlc_gl_Create(&embed_cfg, VLC_OPENGL, modlist);
>           free(modlist);
>           if (!sys->gl)
>           {
>     -        vlc_object_release(surface);
>     +        vlc_object_release(embed_cfg.window);
>               goto error;
>           }
>       
>
>
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez 
> excuser ma brièveté.
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list