[vlc-commits] codec: avcodec: fix and replace inverted deprecation check

Francois Cartegnie git at videolan.org
Thu Feb 25 09:55:33 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan 26 18:00:42 2021 +0100| [991ba74b018a201cc6cc73da713fb3d62fd7ff60] | committer: Francois Cartegnie

codec: avcodec: fix and replace inverted deprecation check

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=991ba74b018a201cc6cc73da713fb3d62fd7ff60
---

 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 13b00e3f26..baff3e4621 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 );



More information about the vlc-commits mailing list