[vlc-devel] [PATCH 2/2] decoder: always release the vout

Steve Lhomme robux4 at ycbcr.xyz
Fri Jun 26 13:47:17 CEST 2020


It seems correct. In input_resource_StartVout() if starting fails we do 
PutVout as well, so it should be OK to put non-started vouts there.

On 2020-06-26 13:26, Thomas Guillem wrote:
> The vout was released only when already started. This fixes the
> "assert( p_resource->i_vout == 0 || p_resource->p_vout_free == p_resource->pp_vout[0] );"
> from input_resource_SetInput() when the vout failed to start.
> ---
>   src/input/decoder.c | 19 +++++++++++--------
>   1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index dd901f77b0c..57b13c14fb3 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -2001,15 +2001,18 @@ static void DeleteDecoder( vlc_input_decoder_t *p_owner )
>           case VIDEO_ES: {
>               vout_thread_t *vout = p_owner->p_vout;
>   
> -            if (vout != NULL && p_owner->vout_thread_started)
> +            if (vout != NULL)
>               {
> -                /* Reset the cancel state that was set before joining the decoder
> -                 * thread */
> -                if (p_owner->out_pool)
> -                    picture_pool_Cancel( p_owner->out_pool, false );
> -                vout_StopDisplay(vout);
> -                p_owner->vout_thread_started = false;
> -                decoder_Notify(p_owner, on_vout_stopped, vout);
> +                if( p_owner->vout_thread_started)
> +                {
> +                    /* Reset the cancel state that was set before joining the
> +                     * decoder thread */
> +                    if (p_owner->out_pool)
> +                        picture_pool_Cancel( p_owner->out_pool, false );
> +                    vout_StopDisplay(vout);
> +                    p_owner->vout_thread_started = false;
> +                    decoder_Notify(p_owner, on_vout_stopped, vout);
> +                }
>                   input_resource_PutVout(p_owner->p_resource, vout);
>               }
>               break;
> -- 
> 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