diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-19 22:07:12 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-03-22 23:57:19 +0100 |
commit | 03b04eef72a5f23e30c2d7700b290d915c31d3a1 (patch) | |
tree | f38ab979e156dd3a5ec293162119b9d537c1db83 /libavformat/smjpegenc.c | |
parent | f4167842c12ad0e406a2bed4c2bb17084b184710 (diff) | |
download | ffmpeg-03b04eef72a5f23e30c2d7700b290d915c31d3a1.tar.gz |
avformat: Enforce one-stream limit where appropriate
Several muxers (e.g. pcm muxers) did not check the number
of streams even though the individual streams were not
recoverable from the muxed files. This commit changes
this by using the FF_OFMT_MAX_ONE_OF_EACH flag
where appropriate.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/smjpegenc.c')
-rw-r--r-- | libavformat/smjpegenc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/smjpegenc.c b/libavformat/smjpegenc.c index 56907c96f7..5b8f41d76d 100644 --- a/libavformat/smjpegenc.c +++ b/libavformat/smjpegenc.c @@ -39,10 +39,6 @@ static int smjpeg_write_header(AVFormatContext *s) AVIOContext *pb = s->pb; int n, tag; - if (s->nb_streams > 2) { - av_log(s, AV_LOG_ERROR, "more than >2 streams are not supported\n"); - return AVERROR(EINVAL); - } avio_write(pb, SMJPEG_MAGIC, 8); avio_wb32(pb, 0); avio_wb32(pb, 0); @@ -139,6 +135,8 @@ const FFOutputFormat ff_smjpeg_muxer = { .priv_data_size = sizeof(SMJPEGMuxContext), .p.audio_codec = AV_CODEC_ID_PCM_S16LE, .p.video_codec = AV_CODEC_ID_MJPEG, + .p.subtitle_codec = AV_CODEC_ID_NONE, + .flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH, .write_header = smjpeg_write_header, .write_packet = smjpeg_write_packet, .write_trailer = smjpeg_write_trailer, |