[vlc-devel] [PATCH 6/7] vout/control: keep waiting until new commands / woken up / deadline

Thomas Guillem thomas at gllm.fr
Fri Aug 14 11:04:45 CEST 2020


vout_control_Pop() was already called from a loop.
A spirious wakeup caused the picture to be rendered again. This is not the case anymore.

You should document it and explain why is it needed.

On Thu, Aug 13, 2020, at 14:12, Steve Lhomme wrote:
> ---
>  src/video_output/control.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/video_output/control.c b/src/video_output/control.c
> index 93bf7c3f92a..a4f92771eda 100644
> --- a/src/video_output/control.c
> +++ b/src/video_output/control.c
> @@ -134,10 +134,10 @@ int vout_control_Pop(vout_control_t *ctrl, 
> vout_control_cmd_t *cmd,
>  {
>      vlc_mutex_lock(&ctrl->lock);
>  
> -    if (ctrl->cmd.i_size <= 0) {
> -        /* Spurious wakeups are perfectly fine */
> -        if (deadline != INVALID_DEADLINE && ctrl->can_sleep) {
> -            vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, deadline);
> +    if (deadline != INVALID_DEADLINE) {
> +        while (ctrl->cmd.i_size <= 0 && ctrl->can_sleep) {
> +            if (vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, deadline))
> +                break;
>          }
>      }
>  
> -- 
> 2.26.2
> 
> _______________________________________________
> 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