[FFmpeg-cvslog] avcodec/encode: silence a deprecation warning about av_init_packet()

James Almer git at videolan.org
Wed Mar 17 21:16:14 EET 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Mar 16 12:01:32 2021 -0300| [039ea9ec7b33bf9ae20efe36747be4712c6833f2] | committer: James Almer

avcodec/encode: silence a deprecation warning about av_init_packet()

No need to adapt this code as it will be removed long before av_init_packet()

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

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

 libavcodec/encode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 63453b7688..a93bb3ccf7 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -462,7 +462,9 @@ static int compat_encode(AVCodecContext *avctx, AVPacket *avpkt,
                     av_buffer_unref(&avpkt->buf);
                     avpkt->buf  = user_pkt.buf;
                     avpkt->data = user_pkt.data;
+FF_DISABLE_DEPRECATION_WARNINGS
                     av_init_packet(&user_pkt);
+FF_ENABLE_DEPRECATION_WARNINGS
                 } else {
                     av_log(avctx, AV_LOG_ERROR, "Provided packet is too small, needs to be %d\n", avpkt->size);
                     av_packet_unref(avpkt);



More information about the ffmpeg-cvslog mailing list