[vlc-devel] [vlc-commits] opengl: forward the error code from the resize callback

Steve Lhomme robux4 at ycbcr.xyz
Thu Jan 17 16:46:15 CET 2019


On 16/01/2019 12:41, Rémi Denis-Courmont wrote:
> This is obviously wrong since it ends with an assertion failure at 
> opengl/display.c:228. And thus the commits before it make no sense.

It asserts there because it's not meant to handle 
VOUT_DISPLAY_RESET_PICTURES. And it receives that because during a 
VOUT_DISPLAY_CHANGE_DISPLAY_SIZE/VOUT_DISPLAY_CHANGE_DISPLAY_FILLED/VOUT_DISPLAY_CHANGE_ZOOM 
it returned an error from a call to vlc_gl_Resize(). If the code is not 
ready to handle such an error (why it occurs for you is another thing to 
look at) then it will also assert on the call right after:

if(vlc_gl_MakeCurrent(sys->gl)!=VLC_SUCCESS)

     returnVLC_EGENERIC;

So I don't see how the commit is wrong. Either the DISPLAY_CHANGE_* 
events can never return an error from there, or the code needs to be 
ready to handle it.

Looking at other display modules (mmal, caopengllayer, macosx), some 
also return errors in VOUT_DISPLAY_CHANGE_DISPLAY_SIZE and assert in 
VOUT_DISPLAY_RESET_PICTURES. From what I understand we can't have both.

android/display also returns an error on 
VOUT_DISPLAY_CHANGE_ZOOM/VOUT_DISPLAY_CHANGE_DISPLAY_FILLED and doesn't 
handle VOUT_DISPLAY_RESET_PICTURES.

> Please revert all.
>
> Le 16 janvier 2019 12:06:53 GMT+02:00, Steve Lhomme <git at videolan.org> 
> a écrit :
>
>     vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jan 16 10:57:55 2019 +0100| [a28dc3049d06a444d73dd2407efcf4fcff878524] | committer: Steve Lhomme
>
>     opengl: forward the error code from the resize callback
>
>     And return an error in VOUT_DISPLAY_CHANGE_DISPLAY_SIZE if resizing fails.
>
>         http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a28dc3049d06a444d73dd2407efcf4fcff878524
>
>
>     ------------------------------------------------------------------------
>       include/vlc_opengl.h                  | 5 +++--
>       modules/video_output/opengl/display.c | 3 ++-
>       2 files changed, 5 insertions(+), 3 deletions(-)
>
>     diff --git a/include/vlc_opengl.h b/include/vlc_opengl.h
>     index 25e28934fa..a2e838b699 100644
>     --- a/include/vlc_opengl.h
>     +++ b/include/vlc_opengl.h
>     @@ -96,10 +96,11 @@ static inline void vlc_gl_ReleaseCurrent(vlc_gl_t *gl)
>           gl->releaseCurrent(gl);
>       }
>       
>     -static inline void vlc_gl_Resize(vlc_gl_t *gl, unsigned w, unsigned h)
>     +static inline int vlc_gl_Resize(vlc_gl_t *gl, unsigned w, unsigned h)
>       {
>           if (gl->resize != NULL)
>     -        gl->resize(gl, w, h);
>     +        return gl->resize(gl, w, h);
>     +    return VLC_SUCCESS;
>       }
>       
>       static inline void vlc_gl_Swap(vlc_gl_t *gl)
>     diff --git a/modules/video_output/opengl/display.c b/modules/video_output/opengl/display.c
>     index 087e288034..14559110dc 100644
>     --- a/modules/video_output/opengl/display.c
>     +++ b/modules/video_output/opengl/display.c
>     @@ -243,7 +243,8 @@ static int Control (vout_display_t *vd, int query, va_list ap)
>                   c.align.vertical = VLC_VIDEO_ALIGN_TOP;
>       
>               vout_display_PlacePicture(&place, src, &c);
>     -        vlc_gl_Resize (sys->gl, c.display.width, c.display.height);
>     +        if (vlc_gl_Resize (sys->gl, c.display.width, c.display.height) != VLC_SUCCESS)
>     +            return VLC_EGENERIC;
>               if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
>                   return VLC_EGENERIC;
>               vout_display_opengl_SetWindowAspectRatio(sys->vgl, (float)place.width / place.height);
>     ------------------------------------------------------------------------
>     vlc-commits mailing list
>     vlc-commits at videolan.org
>     https://mailman.videolan.org/listinfo/vlc-commits
>
>
> -- 
> 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