diff mbox series

[FFmpeg-devel,v2] avcodec/vaapi_encode: fix compilation without CONFIG_VAAPI_1

Message ID 6705f160.2dbc8273.bm000@oddnet.de
State New
Headers show
Series [FFmpeg-devel,v2] avcodec/vaapi_encode: fix compilation without CONFIG_VAAPI_1 | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Ingo Brückl Oct. 9, 2024, 2:48 a.m. UTC
FFmpeg 7.1 as well as the latest development branch do not compile:

  In function 'vaapi_encode_h264_init_picture_params':
  libavcodec/vaapi_encode_h264.c:470:9: error: 'ctx' undeclared

Comments

Xiang, Haihao Oct. 12, 2024, 1:16 a.m. UTC | #1
On Wo, 2024-10-09 at 04:48 +0200, Ingo Brückl wrote:
> FFmpeg 7.1 as well as the latest development branch do not compile:
> 
>   In function 'vaapi_encode_h264_init_picture_params':
>   libavcodec/vaapi_encode_h264.c:470:9: error: 'ctx' undeclared

LGTM, applied

Thanks
Haihao
diff mbox series

Patch

From b6f21f8c432619d46536a3eaee007227772e762e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20Br=C3=BCckl?= <ib@oddnet.de>
Date: Wed, 9 Oct 2024 04:43:01 +0200
Subject: [PATCH] avcodec/vaapi_encode: fix compilation without CONFIG_VAAPI_1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This adds VAAPIEncodeContext *ctx that has been removed
in aa82340b0ccdde4955fba41b8de5e45348ecd11d.

Signed-off-by: Ingo Brückl <ib@oddnet.de>
---
 libavcodec/vaapi_encode_h264.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index fb87b68bec..ed20b9cd24 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -406,6 +406,9 @@  static int vaapi_encode_h264_init_picture_params(AVCodecContext *avctx,
                                                  FFHWBaseEncodePicture *pic)
 {
     FFHWBaseEncodeContext       *base_ctx = avctx->priv_data;
+#if !CONFIG_VAAPI_1
+    VAAPIEncodeContext               *ctx = avctx->priv_data;
+#endif
     VAAPIEncodeH264Context          *priv = avctx->priv_data;
     VAAPIEncodePicture         *vaapi_pic = pic->priv;
     VAAPIEncodeH264Picture          *hpic = pic->codec_priv;
-- 
2.30.2