Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: mkver via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: mkver <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avcodec/pcm_tablegen: Fix hardcoded-tables if alaw,mulaw,vidc codecs disabled (PR #20436)
Message-ID: <175699225979.25.14414814851097696982@463a07221176> (raw)

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

                 reply	other threads:[~2025-09-04 13:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=175699225979.25.14414814851097696982@463a07221176 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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