From 2b8438a495fed569b366b6ba40b611bc6b5d0739 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 16 Apr 2026 16:51:59 +0200 Subject: [PATCH] avformat/pdvenc: Remove always-false checks The number of streams is always one (namely one video stream with codec id AV_CODEC_ID_PDV) due to the MAX_ONE_OF_EACH, ONLY_DEFAULT_CODECS flags. Also, the generic code (init_muxer() in mux.c) checks that video streams have proper dimensions set. Signed-off-by: Andreas Rheinhardt --- libavformat/pdvenc.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libavformat/pdvenc.c b/libavformat/pdvenc.c index 72fc611acc..324c2dfb8a 100644 --- a/libavformat/pdvenc.c +++ b/libavformat/pdvenc.c @@ -80,17 +80,8 @@ static int pdv_write_header(AVFormatContext *s) return AVERROR(EINVAL); } - if (s->nb_streams != 1) { - av_log(s, AV_LOG_ERROR, "PDV muxer supports exactly one stream.\n"); - return AVERROR(EINVAL); - } - st = s->streams[0]; - if (st->codecpar->width <= 0 || st->codecpar->height <= 0) { - av_log(s, AV_LOG_ERROR, "Invalid output dimensions.\n"); - return AVERROR(EINVAL); - } if (st->codecpar->width > UINT16_MAX || st->codecpar->height > UINT16_MAX) { av_log(s, AV_LOG_ERROR, "Output dimensions exceed PDV limits.\n"); return AVERROR(EINVAL);