[vlc-devel] [PATCH 6/7] vout: remove vout_Reset()

Rémi Denis-Courmont remi at remlab.net
Sun Jan 15 14:39:36 CET 2017


Le mercredi 11 janvier 2017, 09:13:13 Thomas Guillem a écrit :
> Pictures from leaking decoders won't be reset anymore. This may cause a
> freeze if a vout is reused after a leaking decoder

> (there is now an assert
> and an error message in that case).

I don't think so.
 
> The call to ThreadFlush(vout, true, INT64_MAX) will be done from
> TheadStop() (from ThreadReinit()).
> ---
>  src/input/decoder.c             |  4 ----
>  src/video_output/video_output.c | 35 -----------------------------------
>  src/video_output/vout_control.h |  5 -----
>  3 files changed, 44 deletions(-)
> 
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 27549e32e1..1e8189af09 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -1793,10 +1793,6 @@ static void DeleteDecoder( decoder_t * p_dec )
>      }
>      if( p_owner->p_vout )
>      {
> -        /* Hack to make sure all the the pictures are freed by the decoder
> -         * and that the vout is not paused anymore */
> -        vout_Reset( p_owner->p_vout );
> -
>          /* */
>          input_resource_RequestVout( p_owner->p_resource, p_owner->p_vout,
> NULL, 0, true );
> diff --git a/src/video_output/video_output.c
> b/src/video_output/video_output.c index 258291422d..a4476db449 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -333,12 +333,6 @@ void vout_Flush(vout_thread_t *vout, mtime_t date)
>      vout_control_WaitEmpty(&vout->p->control);
>  }
> 
> -void vout_Reset(vout_thread_t *vout)
> -{
> -    vout_control_PushVoid(&vout->p->control, VOUT_CONTROL_RESET);
> -    vout_control_WaitEmpty(&vout->p->control);
> -}
> -
>  bool vout_IsEmpty(vout_thread_t *vout)
>  {
>      picture_t *picture = picture_fifo_Peek(vout->p->decoder_fifo);
> @@ -1208,32 +1202,6 @@ static void ThreadFlush(vout_thread_t *vout, bool
> below, mtime_t date) picture_fifo_Flush(vout->p->decoder_fifo, date,
> below);
>  }
> 
> -static void ThreadReset(vout_thread_t *vout)
> -{
> -    ThreadFlush(vout, true, INT64_MAX);
> -    if (vout->p->decoder_pool) {
> -        unsigned count, leaks;
> -
> -        if (vout->p->private_pool != NULL) {
> -            count = picture_pool_GetSize(vout->p->private_pool);
> -            picture_pool_Release(vout->p->private_pool);
> -        }
> -
> -        leaks = picture_pool_Reset(vout->p->decoder_pool);
> -        if (leaks > 0)
> -            msg_Err(vout, "%u picture(s) leaked by decoder", leaks);
> -
> -        if (vout->p->private_pool != NULL) {
> -            vout->p->private_pool =
> picture_pool_Reserve(vout->p->decoder_pool, -                              
>                           count);
> -            if (vout->p->private_pool == NULL)
> -                abort();
> -        }
> -    }
> -    vout->p->pause.is_on = false;
> -    vout->p->pause.date  = mdate();
> -}
> -
>  static void ThreadStep(vout_thread_t *vout, mtime_t *duration)
>  {
>      *duration = 0;
> @@ -1622,9 +1590,6 @@ static int ThreadControl(vout_thread_t *vout,
> vout_control_cmd_t cmd) case VOUT_CONTROL_FLUSH:
>          ThreadFlush(vout, false, cmd.u.time);
>          break;
> -    case VOUT_CONTROL_RESET:
> -        ThreadReset(vout);
> -        break;
>      case VOUT_CONTROL_STEP:
>          ThreadStep(vout, cmd.u.time_ptr);
>          break;
> diff --git a/src/video_output/vout_control.h
> b/src/video_output/vout_control.h index e50c096d93..8fbefa6e1b 100644
> --- a/src/video_output/vout_control.h
> +++ b/src/video_output/vout_control.h
> @@ -51,11 +51,6 @@ void vout_GetResetStatistic( vout_thread_t *p_vout,
> unsigned *pi_displayed, void vout_Flush( vout_thread_t *p_vout, mtime_t
> i_date );
> 
>  /*
> - * Reset the states of the vout.
> - */
> -void vout_Reset( vout_thread_t *p_vout );
> -
> -/*
>   * Cancel the vout, if cancel is true, it won't return any pictures after
> this * call.
>   */

Probably OK.

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list