[FFmpeg-cvslog] avcodec/encode: Fix check for encoders impl. encode-simple API

Andreas Rheinhardt git at videolan.org
Wed Apr 13 19:04:52 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Apr 13 15:29:21 2022 +0200| [3a920372a11607a4ea6e5a2c29b0b5dbf08f275c] | committer: Andreas Rheinhardt

avcodec/encode: Fix check for encoders impl. encode-simple API

FFCodec.cb is a union.

Reviewed-by: Anton Khirnov <anton at khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 6ae47b736c..e7ae2cd4c1 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -589,7 +589,7 @@ int ff_encode_preinit(AVCodecContext *avctx)
     if (avctx->codec_descriptor->props & AV_CODEC_PROP_INTRA_ONLY)
         avctx->internal->intra_only_flag = AV_PKT_FLAG_KEY;
 
-    if (ffcodec(avctx->codec)->cb.encode) {
+    if (ffcodec(avctx->codec)->cb_type == FF_CODEC_CB_TYPE_ENCODE) {
         avci->in_frame = av_frame_alloc();
         if (!avci->in_frame)
             return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list