aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/wvenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-19 23:28:36 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-22 23:57:19 +0100
commita24bccc23859b37e03cbf395b3349cb4f707b3e0 (patch)
tree6fb3d44ad0b78c8e8ebf9c10c83da94e7ef015c6 /libavformat/wvenc.c
parent03b04eef72a5f23e30c2d7700b290d915c31d3a1 (diff)
downloadffmpeg-a24bccc23859b37e03cbf395b3349cb4f707b3e0.tar.gz
avformat/mux: Add flag for "only default codecs allowed"
AVOutputFormat has default codecs for audio, video and subtitle and often these are the only codecs of this type allowed. So add a flag to AVOutputFormat so that this can be checked generically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/wvenc.c')
-rw-r--r--libavformat/wvenc.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/libavformat/wvenc.c b/libavformat/wvenc.c
index 6d5fefe1bc..7da0879050 100644
--- a/libavformat/wvenc.c
+++ b/libavformat/wvenc.c
@@ -31,16 +31,6 @@ typedef struct WvMuxContext {
int64_t samples;
} WvMuxContext;
-static av_cold int wv_init(AVFormatContext *ctx)
-{
- if (ctx->streams[0]->codecpar->codec_id != AV_CODEC_ID_WAVPACK) {
- av_log(ctx, AV_LOG_ERROR, "This muxer only supports a single WavPack stream.\n");
- return AVERROR(EINVAL);
- }
-
- return 0;
-}
-
static int wv_write_packet(AVFormatContext *ctx, AVPacket *pkt)
{
WvMuxContext *s = ctx->priv_data;
@@ -85,9 +75,9 @@ const FFOutputFormat ff_wv_muxer = {
.p.audio_codec = AV_CODEC_ID_WAVPACK,
.p.video_codec = AV_CODEC_ID_NONE,
.p.subtitle_codec = AV_CODEC_ID_NONE,
- .init = wv_init,
.write_packet = wv_write_packet,
.write_trailer = wv_write_trailer,
.p.flags = AVFMT_NOTIMESTAMPS,
- .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH,
+ .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
+ FF_OFMT_FLAG_ONLY_DEFAULT_CODECS,
};