[FFmpeg-cvslog] avformat/utils: add missing FF_API_LAVF_AVCTX check

James Almer git at videolan.org
Fri Oct 2 06:36:26 EEST 2020


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Oct  1 22:47:51 2020 -0300| [a7489c0fbdc7477941655b6c9fd855521f099738] | committer: James Almer

avformat/utils: add missing FF_API_LAVF_AVCTX check

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7489c0fbdc7477941655b6c9fd855521f099738
---

 libavformat/utils.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index cf0654d416..a2e701ea1a 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5704,8 +5704,18 @@ int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
                                                   enum AVTimebaseSource copy_tb)
 {
     //TODO: use [io]st->internal->avctx
-    const AVCodecContext *dec_ctx = ist->codec;
-    AVCodecContext       *enc_ctx = ost->codec;
+    const AVCodecContext *dec_ctx;
+    AVCodecContext       *enc_ctx;
+
+#if FF_API_LAVF_AVCTX
+FF_DISABLE_DEPRECATION_WARNINGS
+    dec_ctx = ist->codec;
+    enc_ctx = ost->codec;
+FF_ENABLE_DEPRECATION_WARNINGS
+#else
+    dec_ctx = ist->internal->avctx;
+    enc_ctx = ost->internal->avctx;
+#endif
 
     enc_ctx->time_base = ist->time_base;
     /*



More information about the ffmpeg-cvslog mailing list