#1144027 bs1770gain: FTBFS with ffmpeg 9.0

Package:
src:bs1770gain
Source:
src:bs1770gain
Submitter:
Sebastian Ramacher
Date:
2026-10-06 13:07:04 UTC
Severity:
normal
Tags:
#1144027#5
Date:
2026-08-09 22:17:22 UTC
From:
To:
Source: bs1770gain
Version: 0.9.8-1
Severity: important
Tags: ftbfs sid forky
X-Debbugs-Cc: sramacher@debian.org

Dear maintainer,

bs1770gain FTBFS with ffmpeg 9.0 (available in experimental):

aarch64-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I../libpbutil -I../lib1770-2 -I/usr/include -Wdate-time -D_FORTIFY_SOURCE=2  -Wstrict-prototypes -Wextra -Wreturn-type -Wcast-qual -Wcast-align -Wpointer-arith -Wformat -Wall -Werror -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/bs1770gain-0.9.8=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -c -o ff_filter.o ff_filter.c
ff_filter.c: In function ‘ff_filter_create’:
ff_filter.c:405:7: error: implicit declaration of function ‘av_opt_set_int_list’; did you mean ‘av_opt_set_int’? [-Wimplicit-function-declaration]
  405 |   err=av_opt_set_int_list(f->ctx.sink,"sample_fmts",
      |       ^~~~~~~~~~~~~~~~~~~
      |       av_opt_set_int
make[3]: *** [Makefile:383: ff_filter.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/build/reproducible-path/bs1770gain-0.9.8/libff'
make[2]: *** [Makefile:396: all-recursive] Error 1
make[2]: Leaving directory '/build/reproducible-path/bs1770gain-0.9.8'
make[1]: *** [Makefile:337: all] Error 2
make[1]: Leaving directory '/build/reproducible-path/bs1770gain-0.9.8'
dh_auto_build: error: make -j2 returned exit code 2
make: *** [debian/rules:7: binary-arch] Error 25

See the attached build log for more details.

Cheers

#1144027#12
Date:
2026-10-05 19:52:52 UTC
From:
To:
[Sebastian Ramacher 2026-08-10]
the command line tool work with this change:


Description: Fix build with FFmpeg 7+.

The following API changes in FFmpeg 7+ break the build:
* av_opt_set_int_list() was removed in libavutil 59 (FFmpeg 7.0);
  replace with av_opt_set() using string values for abuffersink
  filter options.
* av_opt_set_bin() was also removed; replace with av_opt_set() using
  string values.
* AVCodec members sample_fmts, supported_samplerates, and ch_layouts
  were removed in libavcodec 61 (FFmpeg 7.0); simplify encoder setup
  to use direct assignment from codec params.

All changes use #if version guards to maintain compatibility with both
older and newer FFmpeg/glibc versions.

This patch was created with help from OpenCode using local llama.cpp
server with Qwen 3.6.
--- bs1770gain-salsa.orig/libff/ff_audio.c
+++ bs1770gain-salsa/libff/ff_audio.c
@@ -48,7 +48,9 @@ int ff_audio_create(ff_audio_t *audio, f
   AVCodecParameters *codecpar=stream->codecpar;
   AVDictionary *opt=NULL;
   FF_CONST AVCodec *codec;
+#if LIBAVCODEC_VERSION_MAJOR < 61 // [
   int i;
+#endif // ]
   char value[64];
   int err;

@@ -93,6 +95,7 @@ int ff_audio_create(ff_audio_t *audio, f
   ////////////////////////////////////////////////////////////////////////////
   if (ocodecpar) {
     // we're going to encode.
+#if LIBAVCODEC_VERSION_MAJOR < 61 // [
     if (codec->sample_fmts) {
       audio->ctx->sample_fmt=AV_SAMPLE_FMT_NONE;

@@ -233,6 +236,13 @@ int ff_audio_create(ff_audio_t *audio, f

     //audio->ctx->channels
 #endif // ]
+#else // ] [
+    // AVCodec members sample_fmts, supported_samplerates, ch_layouts
+    // were removed in FFmpeg 7.0 (libavcodec 61).
+    audio->ctx->sample_fmt=ocodecpar->format;
+    audio->ctx->sample_rate=ocodecpar->sample_rate;
+    audio->ctx->ch_layout=ocodecpar->ch_layout;
+#endif // ]

     audio->ctx->time_base.num=1;
     audio->ctx->time_base.den=audio->ctx->sample_rate;
--- bs1770gain-salsa.orig/libff/ff_filter.c
+++ bs1770gain-salsa/libff/ff_filter.c
@@ -395,6 +395,7 @@ e_filter_graph:

   /////////////////////////////////////////////////////////////////////////////
 #if defined (FF_SAMPLE_FMTS_DEPRECATED_FIX) // [
+#if LIBAVUTIL_VERSION_MAJOR < 59 // [
   /*
   err= avcodec_get_supported_config(dec_ctx,NULL,AV_CODEC_CONFIG_PIX_FORMAT,
       0,(const void**)&sink_sample_fmts,NULL);
@@ -402,8 +403,25 @@ e_filter_graph:
   err=av_opt_set_bin(f->ctx.sink,"sample_fmts",
       sink_sample_fmts,-1,AV_OPT_SEARCH_CHILDREN|AV_OPT_TYPE_FLAG_ARRAY);
 #else // ] [
+  {
+    char sample_fmts_str[256];
+    snprintf(sample_fmts_str, sizeof(sample_fmts_str), "%s",
+             av_get_sample_fmt_name(ocodecpar->format));
+    err=av_opt_set(f->ctx.sink,"sample_fmts",sample_fmts_str,AV_OPT_SEARCH_CHILDREN);
+  }
+#endif // ]
+#else // ] [
+#if LIBAVUTIL_VERSION_MAJOR < 59 // [
   err=av_opt_set_int_list(f->ctx.sink,"sample_fmts",
       sink_sample_fmts,-1,AV_OPT_SEARCH_CHILDREN);
+#else // ] [
+  {
+    char sample_fmts_str[256];
+    snprintf(sample_fmts_str, sizeof(sample_fmts_str), "%s",
+             av_get_sample_fmt_name(ocodecpar->format));
+    err=av_opt_set(f->ctx.sink,"sample_fmts",sample_fmts_str,AV_OPT_SEARCH_CHILDREN);
+  }
+#endif // ]
 #endif // ]

   if (err<0) {
@@ -413,9 +431,14 @@ e_filter_graph:

   /////////////////////////////////////////////////////////////////////////////
 #if defined (FF_BITMASK_BASED_CHANNEL_LAYOUT) // [
+#if LIBAVUTIL_VERSION_MAJOR < 59 // [
   err=av_opt_set_int_list(f->ctx.sink,"channel_layouts",
       sink_channel_layouts,-1,AV_OPT_SEARCH_CHILDREN);
-#elif 1 // ] [
+#else // ] [
+  av_channel_layout_describe(&ocodecpar->ch_layout, args, sizeof(args));
+  err=av_opt_set(f->ctx.sink,"ch_layouts",args,AV_OPT_SEARCH_CHILDREN);
+#endif // ]
+#else // ] [
   av_channel_layout_describe(&ocodecpar->ch_layout,
     args,sizeof(args));
   err=av_opt_set(f->ctx.sink,"ch_layouts",args,AV_OPT_SEARCH_CHILDREN);
@@ -429,8 +452,17 @@ e_filter_graph:
   /////////////////////////////////////////////////////////////////////////////
 #if defined (FF_SAMPLE_FMTS_DEPRECATED_FIX) // [
 #else // ] [
+#if LIBAVUTIL_VERSION_MAJOR < 59 // [
   err=av_opt_set_int_list(f->ctx.sink,"sample_rates",
       sink_sample_rates,-1,AV_OPT_SEARCH_CHILDREN);
+#else // ] [
+  {
+    char sample_rates_str[64];
+    snprintf(sample_rates_str, sizeof(sample_rates_str), "%d",
+             ocodecpar->sample_rate);
+    err=av_opt_set(f->ctx.sink,"sample_rates",sample_rates_str,AV_OPT_SEARCH_CHILDREN);
+  }
+#endif // ]
 #endif // ]

   if (err<0) {

#1144027#19
Date:
2026-10-06 07:36:58 UTC
From:
To:
Here is a new and improved patch, better reflecting the ffmpeg versions
in question.  Tested with both ffmpeg 7 and 9.

#1144027#22
Date:
2026-10-06 07:43:02 UTC
From:
To:
Hello,

Bug #1144027 in bs1770gain reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/multimedia-team/bs1770gain/-/commit/051fc45399c67f2d3540d94dd52690cc540e3014
------------------------------------------------------------------------
Added 1000-ffmpeg-av-opt-set-int-list-removed.patch to build with FFMPEG 9.

Closes: #1144027
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1144027

#1144027#27
Date:
2026-10-06 13:04:56 UTC
From:
To:
Hello,

Bug #1144027 in bs1770gain reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/multimedia-team/bs1770gain/-/commit/d5f47c59ab308a5adc5035aeb4529c8779d2cb6b
------------------------------------------------------------------------
Added 1020-configure-postproc-removed.patch making postproc lib optional.

Closes: #1144027
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1144027