* [FFmpeg-devel] [PATCH] avcodec/pcm_tablegen: Fix hardcoded-tables if alaw,mulaw,vidc codecs disabled (PR #20436)
@ 2025-09-04 13:24 mkver via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: mkver via ffmpeg-devel @ 2025-09-04 13:24 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: mkver
PR #20436 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20436
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20436.patch
Given that the various tableinit functions are no longer compiled unconditionally, one gets a compilation failure in pcm_tablegen.c (which creates the tables to be hardcoded) when both the encoder as well as the decoder are disabled for any one of {alaw,mulaw,vidc}. This commit fixes this scenario. It is intended to be applied after #20394 (otherwise, it would cause a regression when only the encoder is disabled with the decoder enabled).
>From 4aabe5c9169d1242c4a2ba64e9943ab19cf4721f Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
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.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
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 <stdlib.h>
+#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;
}
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-04 13:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-04 13:24 [FFmpeg-devel] [PATCH] avcodec/pcm_tablegen: Fix hardcoded-tables if alaw,mulaw,vidc codecs disabled (PR #20436) mkver via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git