diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-19 23:28:36 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-22 23:57:19 +0100 |
commit | a24bccc23859b37e03cbf395b3349cb4f707b3e0 (patch) | |
tree | 6fb3d44ad0b78c8e8ebf9c10c83da94e7ef015c6 /libavformat/adtsenc.c | |
parent | 03b04eef72a5f23e30c2d7700b290d915c31d3a1 (diff) | |
download | ffmpeg-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/adtsenc.c')
-rw-r--r-- | libavformat/adtsenc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index 7eaf91630c..0671224fc2 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -106,10 +106,6 @@ static int adts_init(AVFormatContext *s) ADTSContext *adts = s->priv_data; AVCodecParameters *par = s->streams[0]->codecpar; - if (par->codec_id != AV_CODEC_ID_AAC) { - av_log(s, AV_LOG_ERROR, "Only AAC streams can be muxed by the ADTS muxer\n"); - return AVERROR(EINVAL); - } if (par->extradata_size > 0) return adts_decode_extradata(s, adts, par->extradata, par->extradata_size); @@ -242,7 +238,8 @@ const FFOutputFormat ff_adts_muxer = { .p.audio_codec = AV_CODEC_ID_AAC, .p.video_codec = AV_CODEC_ID_NONE, .p.subtitle_codec = AV_CODEC_ID_NONE, - .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH, + .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH | + FF_OFMT_FLAG_ONLY_DEFAULT_CODECS, .init = adts_init, .write_header = adts_write_header, .write_packet = adts_write_packet, |