From 67d7df54e02ee50dd885562356958dd6e60a71e3 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 31 Mar 2025 21:27:29 +0200
Subject: [PATCH 11/12] avcodec/vdpau: Only include mpegvideodec.h when used

mpegvideodec.h includes mpegvideodata.h which in turn contains
a "static const uint8_t *const ff_mpeg1_dc_scale_table =
ff_mpeg12_dc_scale_table[0]"; yet if mpegvideo is disabled,
ff_mpeg12_dc_scale_table is not available, yet a non-optimizing
compiler (like GCC with -O0) may emit ff_mpeg1_dc_scale_table
and therefore a reference to ff_mpeg12_dc_scale_table nevertheless.

Fix this by only including mpegvideodec.h if it is needed.

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

diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
index 23c2e3a55d..e99ac5338d 100644
--- a/libavcodec/vdpau.c
+++ b/libavcodec/vdpau.c
@@ -28,7 +28,6 @@
 #include "decode.h"
 #include "hwaccel_internal.h"
 #include "internal.h"
-#include "mpegvideodec.h"
 #include "vdpau.h"
 #include "vdpau_internal.h"
 
@@ -353,6 +352,8 @@ int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
 #if CONFIG_MPEG1_VDPAU_HWACCEL || \
     CONFIG_MPEG2_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL || \
     CONFIG_VC1_VDPAU_HWACCEL   || CONFIG_WMV3_VDPAU_HWACCEL
+#include "mpegvideodec.h"
+
 int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
 {
     MpegEncContext *s = avctx->priv_data;
-- 
2.45.2