[vlc-devel] [PATCH 1/2] avcodec: do not cancel the pending picture requests on Flush

Thomas Guillem thomas at gllm.fr
Thu Jul 9 14:08:12 CEST 2020


3 patches set LGTM.

decoder_AbortPictures() is not needed anymore. When I remove decoder_AbortPictures(), the same sample on the same machine deadlock on VLC 3.x and is OK on VLC 4.x.

On Thu, Jul 9, 2020, at 12:45, Steve Lhomme wrote:
> On 2020-07-09 12:33, Francois Cartegnie wrote:
> > Le 09/07/2020 à 11:56, Steve Lhomme a écrit :
> >>   
> >> -    /* Abort pictures in order to unblock all avcodec workers threads waiting
> >> -     * for a picture. This will avoid a deadlock between avcodec_flush_buffers
> >> -     * and workers threads */
> >> -    decoder_AbortPictures( p_dec, true );
> >> -
> >>       /* do not flush buffers if codec hasn't been opened (theora/vorbis/VC1) */
> >>       if( avcodec_is_open( p_context ) )
> >>           avcodec_flush_buffers( p_context );
> >>   
> >>       date_Set(&p_sys->pts, VLC_TICK_INVALID); /* To make sure we recover properly */
> >> -
> >> -    /* Reset cancel state to false */
> >> -    decoder_AbortPictures( p_dec, false );
> >>   }
> > 
> > Having output of pictures after a change in timeline/continuity
> > will create inconsistency with the timestamps and maybe sidedata.
> 
> That's the job of libavcodec not to push frames from before the flush 
> occured. What decoder_AbortPictures() does is just giving it NULL frames 
> while we are doing the flush.
> _______________________________________________
> 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