[FFmpeg-cvslog] lavc/libaomdec: fix build with 1.0.0

Anton Khirnov git at videolan.org
Sun Apr 18 09:40:16 EEST 2021


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Apr 17 16:12:30 2021 +0200| [d43b26b30dabc6004142b86a87c1d6730735b11c] | committer: Anton Khirnov

lavc/libaomdec: fix build with 1.0.0

aom_codec_frame_flags_t in libaom 1.0.0 is defined in aom_encoder.h,
whereas for newer versions it was moved to aom_codec.h

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

 libavcodec/libaomdec.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 6de3bcc5c3..4b9125a32c 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -161,7 +161,6 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame,
     AVFrame *picture      = data;
     const void *iter      = NULL;
     struct aom_image *img;
-    aom_codec_frame_flags_t av_unused flags;
     int ret;
 
     if (aom_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL) !=
@@ -200,15 +199,18 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame,
             return ret;
 
 #ifdef AOM_CTRL_AOMD_GET_FRAME_FLAGS
-        ret = aom_codec_control(&ctx->decoder, AOMD_GET_FRAME_FLAGS, &flags);
-        if (ret == AOM_CODEC_OK) {
-            picture->key_frame = !!(flags & AOM_FRAME_IS_KEY);
-            if (flags & (AOM_FRAME_IS_KEY | AOM_FRAME_IS_INTRAONLY))
-                picture->pict_type = AV_PICTURE_TYPE_I;
-            else if (flags & AOM_FRAME_IS_SWITCH)
-                picture->pict_type = AV_PICTURE_TYPE_SP;
-            else
-                picture->pict_type = AV_PICTURE_TYPE_P;
+        {
+            aom_codec_frame_flags_t flags;
+            ret = aom_codec_control(&ctx->decoder, AOMD_GET_FRAME_FLAGS, &flags);
+            if (ret == AOM_CODEC_OK) {
+                picture->key_frame = !!(flags & AOM_FRAME_IS_KEY);
+                if (flags & (AOM_FRAME_IS_KEY | AOM_FRAME_IS_INTRAONLY))
+                    picture->pict_type = AV_PICTURE_TYPE_I;
+                else if (flags & AOM_FRAME_IS_SWITCH)
+                    picture->pict_type = AV_PICTURE_TYPE_SP;
+                else
+                    picture->pict_type = AV_PICTURE_TYPE_P;
+            }
         }
 #endif
 



More information about the ffmpeg-cvslog mailing list