From 87cb7c871b6b25e537a7b19e47bf2779ad8d31b4 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 4 Sep 2025 14:56:13 +0200 Subject: [PATCH] avcodec/pcm_tablegen: Fix hardcoded-tables if alaw,mulaw,vidc codecs disabled Since ae448e00afb43d7f72dfa9c82a4c45994e4fea6a the various tableinit functions are not compiled unconditionally any more, so that pcm_tablegen.c (which creates the hardcoded tables) needs to be updated. Reviewed-by: James Almer Signed-off-by: Andreas Rheinhardt --- libavcodec/pcm_tablegen.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libavcodec/pcm_tablegen.c b/libavcodec/pcm_tablegen.c index 473a47f6d9..cff713606b 100644 --- a/libavcodec/pcm_tablegen.c +++ b/libavcodec/pcm_tablegen.c @@ -21,21 +21,27 @@ */ #include +#include "config_components.h" #define CONFIG_HARDCODED_TABLES 0 #include "pcm_tablegen.h" #include "tableprint.h" int main(void) { - pcm_alaw_tableinit(); - pcm_ulaw_tableinit(); - pcm_vidc_tableinit(); - write_fileheader(); +#if CONFIG_PCM_ALAW_ENCODER + pcm_alaw_tableinit(); WRITE_ARRAY("static const", uint8_t, linear_to_alaw); +#endif +#if CONFIG_PCM_MULAW_ENCODER + pcm_ulaw_tableinit(); WRITE_ARRAY("static const", uint8_t, linear_to_ulaw); +#endif +#if CONFIG_PCM_VIDC_ENCODER + pcm_vidc_tableinit(); WRITE_ARRAY("static const", uint8_t, linear_to_vidc); +#endif return 0; }