Bug#1072434: mgba: FTBFS with ffmpeg 7.0: ffmpeg-encoder.c:323:31: error: ‘struct AVCodecContext’ has no member named ‘channels’

Sebastian Ramacher sramacher at debian.org
Sun Jun 2 14:22:17 BST 2024


Source: mgba
Version: 0.10.2+dfsg-1.1
Severity: important
Tags: trixie sid ftbfs
Usertags: ffmpeg-7.0

Hi,

during a rebuild of the reverse dependencies for the transition to
ffmpeg 7.0, your package failed to build


Relevant part (hopefully):
> /usr/bin/cc -DBUILD_GL -DBUILD_GLES2 -DBUILD_GLES3 -DENABLE_SCRIPTING -DHAVE_CRC32 -DHAVE_FREELOCALE -DHAVE_FUTIMENS -DHAVE_FUTIMES -DHAVE_LOCALE -DHAVE_LOCALTIME_R -DHAVE_NEWLOCALE -DHAVE_PTHREAD_CREATE -DHAVE_PTHREAD_SETNAME_NP -DHAVE_SETLOCALE -DHAVE_STRDUP -DHAVE_STRLCPY -DHAVE_STRNDUP -DHAVE_USELOCALE -DHAVE_VASPRINTF -DLUA_VERSION_ONLY=\"5.4\" -DMGBA_DLL -DM_CORE_GB -DM_CORE_GBA -DUSE_DEBUGGERS -DUSE_DISCORD_RPC -DUSE_EDITLINE -DUSE_EGL -DUSE_ELF -DUSE_FFMPEG -DUSE_GDB_STUB -DUSE_GLX -DUSE_LIBSWRESAMPLE -DUSE_LIBZIP -DUSE_LUA -DUSE_LZMA -DUSE_PNG -DUSE_PTHREADS -DUSE_SQLITE3 -DUSE_ZLIB -D_7ZIP_PPMD_SUPPPORT -D_GNU_SOURCE -Dmgba_EXPORTS -I/<<PKGBUILDDIR>>/include -I/<<PKGBUILDDIR>>/obj-aarch64-linux-gnu/include -I/<<PKGBUILDDIR>>/src -I/usr/include/editline -I/<<PKGBUILDDIR>>/src/third-party/lzma -I/<<PKGBUILDDIR>>/src/third-party/discord-rpc/include -I/usr/include/lua5.4 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -mbranch-protection=standard -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wno-missing-field-initializers -Werror=implicit-function-declaration -pthread -std=c11 -fPIC -MD -MT CMakeFiles/mgba.dir/src/feature/ffmpeg/ffmpeg-decoder.c.o -MF CMakeFiles/mgba.dir/src/feature/ffmpeg/ffmpeg-decoder.c.o.d -o CMakeFiles/mgba.dir/src/feature/ffmpeg/ffmpeg-decoder.c.o -c /<<PKGBUILDDIR>>/src/feature/ffmpeg/ffmpeg-decoder.c
> /<<PKGBUILDDIR>>/src/feature/ffmpeg/ffmpeg-encoder.c: In function ‘FFmpegEncoderOpen’:
> /<<PKGBUILDDIR>>/src/feature/ffmpeg/ffmpeg-encoder.c:323:31: error: ‘struct AVCodecContext’ has no member named ‘channels’
>   323 |                 encoder->audio->channels = 2;
>       |                               ^~
> /<<PKGBUILDDIR>>/src/feature/ffmpeg/ffmpeg-encoder.c:324:33: error: ‘struct AVCodecContext’ has no member named ‘channel_layout’; did you mean ‘ch_layout’?
>   324 |                 encoder->audio->channel_layout = AV_CH_LAYOUT_STEREO;
>       |                                 ^~~~~~~~~~~~~~
>       |                                 ch_layout
> /<<PKGBUILDDIR>>/src/feature/ffmpeg/ffmpeg-encoder.c:349:38: error: ‘AVFrame’ has no member named ‘channel_layout’; did you mean ‘ch_layout’?
>   349 |                 encoder->audioFrame->channel_layout = AV_CH_LAYOUT_STEREO;
>       |                                      ^~~~~~~~~~~~~~
>       |                                      ch_layout
> /<<PKGBUILDDIR>>/src/feature/ffmpeg/ffmpeg-encoder.c: In function ‘_ffmpegOpenResampleContext’:
> /<<PKGBUILDDIR>>/src/feature/ffmpeg/ffmpeg-encoder.c:912:36: error: implicit declaration of function ‘swr_alloc_set_opts’; did you mean ‘swr_alloc_set_opts2’? [-Werror=implicit-function-declaration]
>   912 |         encoder->resampleContext = swr_alloc_set_opts(NULL, AV_CH_LAYOUT_STEREO, encoder->sampleFormat, encoder->sampleRate,
>       |                                    ^~~~~~~~~~~~~~~~~~
>       |                                    swr_alloc_set_opts2
> /<<PKGBUILDDIR>>/src/feature/ffmpeg/ffmpeg-encoder.c:912:34: warning: assignment to ‘struct SwrContext *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>   912 |         encoder->resampleContext = swr_alloc_set_opts(NULL, AV_CH_LAYOUT_STEREO, encoder->sampleFormat, encoder->sampleRate,
>       |                                  ^
> cc1: some warnings being treated as errors
> make[3]: *** [CMakeFiles/mgba.dir/build.make:1913: CMakeFiles/mgba.dir/src/feature/ffmpeg/ffmpeg-encoder.c.o] Error 1


The full build log is available from:
https://people.debian.org/~sramacher/ffmpeg-7.0/mgba_arm64.build

ffmpeg 7.0 is available in experimental.

Cheers

-- 
Sebastian Ramacher



More information about the Pkg-games-devel mailing list