[vlc-devel] [PATCH 2/9] video_output: simplify the locking of the display in vout_UpdateWindowSizeLocked

Thomas Guillem thomas at gllm.fr
Thu Oct 10 17:32:34 CEST 2019


It is just a question of taste. The actual code is OK to me.

When I develop, I tend to do like this current code instead of creating an extra variable.

I have nothing about this way or another but I don't think this commit is really needed.

On Thu, Oct 10, 2019, at 16:26, Steve Lhomme wrote:
> ---
>  src/video_output/video_output.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/video_output/video_output.c 
> b/src/video_output/video_output.c
> index a5046913867..874d51f8e08 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -201,15 +201,17 @@ static void 
> vout_UpdateWindowSizeLocked(vout_thread_t *vout)
>  
>      vlc_mutex_assert(&sys->window_lock);
>  
> +    bool new_size = false;
>      vlc_mutex_lock(&sys->display_lock);
>      if (sys->display != NULL) {
> +        new_size = true;
>          vout_SizeWindow(vout, &width, &height);
> -        vlc_mutex_unlock(&sys->display_lock);
> -
>          msg_Dbg(vout, "requested window size: %ux%u", width, height);
> +    }
> +    vlc_mutex_unlock(&sys->display_lock);
> +
> +    if (new_size)
>          vout_window_SetSize(vout->p->display_cfg.window, width, height);
> -    } else
> -        vlc_mutex_unlock(&sys->display_lock);
>  }
>  
>  /* */
> -- 
> 2.17.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