configure: Redo enabling cbs in lavf

Right now, the cbs_type_table (the table of all CodedBitstreamTypes
supported by CBS) is empty unless cbs_apv and cbs_av1 is enabled.
The latter are only enabled in configure if they are needed in lavc.
This means that the mov muxers (the only users of cbs-in-lavf)
don't work as they should depending upon the availability of
e.g. the av1_metadata BSF. The table being empty is also illegal C
and according to PR #23038 MSVC warns about this (as does GCC
with -pedantic) and it may even lead to an internal compiler error.

This could be fixed by simply adding a mov_muxer->cbs_av1,cbs_apv
dependency in configure, yet this would have the downside that
it would force cbs_av1 and cbs_apv to be built for lavc, too,
even though it may not be needed there. So add new configure
variables cbs_{apv,av1}_lavf and cbs_lavf to track this correctly.

Reported-by: xiaozhuai <798047000@qq.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Reviewed-by: xiaozhuai <798047000@qq.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2026-05-07 13:25:29 +02:00
parent 0f45541e04
commit 6a59c847b5
3 changed files with 10 additions and 2 deletions
+3 -1
View File
@@ -40,6 +40,8 @@ OBJS = allformats.o \
OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
# subsystems
OBJS-$(CONFIG_CBS_APV_LAVF) += cbs_apv.o cbs.o
OBJS-$(CONFIG_CBS_AV1_LAVF) += cbs_av1.o cbs.o
OBJS-$(CONFIG_ISO_MEDIA) += isom.o
OBJS-$(CONFIG_ISO_WRITER) += avc.o hevc.o vvc.o
OBJS-$(CONFIG_IAMFDEC) += iamf_reader.o iamf_parse.o iamf.o
@@ -390,7 +392,7 @@ OBJS-$(CONFIG_MOV_DEMUXER) += mov.o mov_chan.o mov_esds.o \
OBJS-$(CONFIG_MOV_MUXER) += movenc.o \
movenchint.o mov_chan.o rtp.o \
movenccenc.o movenc_ttml.o rawutils.o \
apv.o dovi_isom.o evc.o cbs.o cbs_av1.o cbs_apv.o
apv.o dovi_isom.o evc.o
OBJS-$(CONFIG_MP2_MUXER) += rawenc.o
OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o replaygain.o
OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o
+4
View File
@@ -19,9 +19,13 @@
#ifndef AVFORMAT_CBS_H
#define AVFORMAT_CBS_H
#include "config.h"
#define CBS_PREFIX lavf_cbs
#define CBS_WRITE 0
#define CBS_TRACE 0
#define CBS_APV CONFIG_CBS_APV_LAVF
#define CBS_AV1 CONFIG_CBS_AV1_LAVF
#define CBS_H264 0
#define CBS_H265 0
#define CBS_H266 0