[vlc-devel] [PATCH 03/13] vout: nul display pointer when appropriate

Rémi Denis-Courmont remi at remlab.net
Thu Jun 13 12:06:53 CEST 2019


Le jeudi 13 juin 2019, 08:55:44 EEST Thomas Guillem a écrit :
> Hi,
> 
> On Wed, Jun 12, 2019, at 19:48, Rémi Denis-Courmont wrote:
> > This makes sure that the display pointer is NULL when there is no
> > display. That way, we can access the display outside the the vout
> > control thread.
> > ---
> > 
> >  src/video_output/video_output.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/video_output/video_output.c
> > b/src/video_output/video_output.c
> > index 3768d80112..0baba7e055 100644
> > --- a/src/video_output/video_output.c
> > +++ b/src/video_output/video_output.c
> > @@ -1493,6 +1493,7 @@ static int vout_Start(vout_thread_t *vout, const
> > vout_configuration_t *cfg)
> > 
> >      vlc_mutex_unlock(&sys->window_lock);
> >      
> >      if (vout_OpenWrapper(vout, sys->splitter_name, &dcfg)) {
> > 
> > +        assert(sys->display == NULL);
> > 
> >          vlc_mutex_unlock(&sys->display_lock);
> >          goto error;
> >      
> >      }
> > 
> > @@ -1669,13 +1670,14 @@ void vout_StopDisplay(vout_thread_t *vout)
> > 
> >      if (sys->spu_blend != NULL)
> >      
> >          filter_DeleteBlend(sys->spu_blend);
> > 
> > -    /* Destroy translation tables */
> > +    /* Destroy the rendering display */
> > 
> >      if (sys->display != NULL) {
> >      
> >          if (sys->decoder_pool != NULL)
> >          
> >              vout_FlushUnlocked(vout, true, INT64_MAX);
> >          
> >          vlc_mutex_lock(&sys->display_lock);
> >          vout_CloseWrapper(vout);
> > 
> > +        sys->display = NULL;
> 
> It looks weird that the display pointer is set to NULL outside of
> vout_CloseWrapper() since it is initialized from vout_OpenWrapper().

True but unavoidable as it must be initialized before the wrapper is opened.

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list