diff mbox series

[FFmpeg-devel,1/4] avcodec/encode: Fix check for encoders impl. encode-simple API

Message ID AS8PR01MB794407382EC42678297ECB248FEC9@AS8PR01MB7944.eurprd01.prod.exchangelabs.com
State Accepted
Commit 3a920372a11607a4ea6e5a2c29b0b5dbf08f275c
Headers show
Series [FFmpeg-devel,1/4] avcodec/encode: Fix check for encoders impl. encode-simple API | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 13, 2022, 2:43 p.m. UTC
FFCodec.cb is a union.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anton Khirnov April 13, 2022, 3:57 p.m. UTC | #1
Quoting Andreas Rheinhardt (2022-04-13 16:43:28)
> FFCodec.cb is a union.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  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);
> -- 
> 2.32.0

Patches 1, 2, 4 look good.

Thank you and sorry for the breakage.
diff mbox series

Patch

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);