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/bit.c | |
parent | 03b04eef72a5f23e30c2d7700b290d915c31d3a1 (diff) |
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/bit.c')
-rw-r--r-- | libavformat/bit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/bit.c b/libavformat/bit.c index 81a954c392..cd088b87ff 100644 --- a/libavformat/bit.c +++ b/libavformat/bit.c @@ -129,7 +129,7 @@ static int write_header(AVFormatContext *s) { AVCodecParameters *par = s->streams[0]->codecpar; - if ((par->codec_id != AV_CODEC_ID_G729) || par->ch_layout.nb_channels != 1) { + if (par->ch_layout.nb_channels != 1) { av_log(s, AV_LOG_ERROR, "only codec g729 with 1 channel is supported by this format\n"); return AVERROR(EINVAL); @@ -168,7 +168,8 @@ const FFOutputFormat ff_bit_muxer = { .p.audio_codec = AV_CODEC_ID_G729, .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, .write_header = write_header, .write_packet = write_packet, }; |