[vlc-devel] [PATCH 1/2] avcodec: do not cancel the pending picture requests on Flush
Steve Lhomme
robux4 at ycbcr.xyz
Thu Jul 9 12:45:42 CEST 2020
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.
More information about the vlc-devel
mailing list