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

Thomas Guillem thomas at gllm.fr
Thu Jun 13 07:55:44 CEST 2019


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().

>          vlc_mutex_unlock(&sys->display_lock);
>      }
>  
> @@ -1848,6 +1850,7 @@ vout_thread_t *vout_Create(vlc_object_t *object)
>      vlc_mutex_init(&sys->filter.lock);
>  
>      /* Display */
> +    sys->display = NULL;
>      vlc_mutex_init(&sys->display_lock);
>  
>      /* Window */
> -- 
> 2.20.1
> 
> _______________________________________________
> 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