[vlc-devel] [PATCH 3/8] decoder: check missing picture dates early
Thomas Guillem
thomas at gllm.fr
Tue Aug 27 10:00:39 CEST 2019
On Tue, Aug 27, 2019, at 07:28, Steve Lhomme wrote:
> Especially before we check this date against the i_preroll_end.
> ---
> src/input/decoder.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 5935b284c6..419505e4f4 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -987,6 +987,13 @@ static bool DecoderPlayVideo( struct decoder_owner
> *p_owner, picture_t *p_pictur
> vout_thread_t *p_vout = p_owner->p_vout;
> bool prerolled;
>
> + if( p_picture->date == VLC_TICK_INVALID )
> + {
> + msg_Warn( p_dec, "non-dated video buffer received" );
> + picture_Release( p_picture );
> + return false;
> + }
Maybe we could use an assert and enforce that decoder modules don't send invalid picture (but that's not related to this patch set).
> +
> vlc_mutex_lock( &p_owner->lock );
> if( p_owner->i_preroll_end > p_picture->date )
> {
> @@ -1007,12 +1014,6 @@ static bool DecoderPlayVideo( struct
> decoder_owner *p_owner, picture_t *p_pictur
> vout_FlushAll( p_vout );
> }
>
> - if( p_picture->date == VLC_TICK_INVALID )
> - {
> - msg_Warn( p_dec, "non-dated video buffer received" );
> - goto discard;
> - }
> -
> /* */
> vlc_mutex_lock( &p_owner->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