[vlc-devel] [PATCH] video_output: explicit vlc_testcancel

Thomas Guillem thomas at gllm.fr
Wed Feb 26 11:11:49 CET 2020


Why is it not canceled from vlc_cond_timedwait() called from vout_control_Pop() ?

Is ctrl->can_sleep false in your case ?

Anyway, I would prefer a fix in vout_control_Pop() like this:

    if (ctrl->cmd.i_size <= 0 && deadline != VLC_TICK_INVALID && ctrl->can_sleep) {
        /* Spurious wakeups are perfectly fine */
        ctrl->is_waiting = true;
        vlc_cond_signal(&ctrl->wait_available);
        vlc_cond_timedwait(&ctrl->wait_request, &ctrl->lock, deadline);
        ctrl->is_waiting = false;
    }
    else
        vlc_testcancel();

On Tue, Feb 25, 2020, at 12:47, quentin.chateau at deepskycorp.com wrote:
> From: Quentin Chateau <quentin.chateau at deepskycorp.com>
> 
> When ThreadDisplayPicture does not return VLC_SUCCESS,
> explicitely check for thread cancellation.
> 
> There are cases where a video filter can fail
> systematically without hitting any cancellation point
> after the video output thread is cancelled, resulting
> in an infinite loop if there is no explicit check.
> ---
>  src/video_output/video_output.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
> index 229b010a96..f7aac554e4 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -1703,6 +1703,7 @@ noreturn static void *Thread(void *object)
>  
>          if (wait)
>          {
> +            vlc_testcancel();
>              const vlc_tick_t max_deadline = vlc_tick_now() + 
> VLC_TICK_FROM_MS(100);
>              deadline = deadline == VLC_TICK_INVALID ? max_deadline : 
> __MIN(deadline, max_deadline);
>          } else {
> -- 
> 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