[vlc-devel] [PATCH 1/2] codec: avcodec: fix and replace inverted deprecation check

Steve Lhomme robux4 at ycbcr.xyz
Fri Feb 5 14:54:46 UTC 2021


There are 2 distinct changes in this patch. IMO they should be separated 
as they don't seem related and may or may not need to be reverted if we 
find issues with them.

As for FF_API_PKT_PTS it's (LIBAVUTIL_VERSION_MAJOR < 57), that means an 
API that should be dropped in lavutil 57.  It should not matter which 
version of 57 had it removed (for now we require at least 55.9.0).

On 2021-02-05 15:33, Francois Cartegnie wrote:
> ---
>   modules/codec/avcodec/video.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
> index 13b00e3f26d..baff3e46214 100644
> --- a/modules/codec/avcodec/video.c
> +++ b/modules/codec/avcodec/video.c
> @@ -1078,11 +1078,14 @@ static int DecodeBlock( decoder_t *p_dec, block_t **pp_block )
>           vlc_mutex_lock(&p_sys->lock);
>   
>           /* Compute the PTS */
> -#ifdef FF_API_PKT_PTS
> -        int64_t av_pts = frame->pts == AV_NOPTS_VALUE ? frame->pkt_dts : frame->pts;
> +#if LIBAVCODEC_VERSION_CHECK( 57, 24, 0, 61, 100 )
> +        int64_t av_pts = frame->pts;
>   #else
>           int64_t av_pts = frame->pkt_pts;
>   #endif
> +        if( av_pts == AV_NOPTS_VALUE )
> +            av_pts = frame->pkt_dts;
> +
>           vlc_tick_t i_pts;
>           if( av_pts == AV_NOPTS_VALUE )
>               i_pts = date_Get( &p_sys->pts );
> -- 
> 2.26.2
> 
> _______________________________________________
> 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