avformat/mux_utils: Don't report that AV_CODEC_ID_NONE can be muxed

If AVOutputFormat.video_codec, audio_codec or subtitle_codec
is AV_CODEC_ID_NONE, it means that there is no default codec
for this format and not that it is supported to mux AV_CODEC_ID_NONE.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-03-19 19:42:55 +01:00
parent 789c5b03db
commit a48e839a22
1 changed files with 4 additions and 3 deletions

View File

@ -39,9 +39,10 @@ int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
return ffofmt(ofmt)->query_codec(codec_id, std_compliance);
else if (ofmt->codec_tag)
return !!av_codec_get_tag2(ofmt->codec_tag, codec_id, &codec_tag);
else if (codec_id == ofmt->video_codec ||
codec_id == ofmt->audio_codec ||
codec_id == ofmt->subtitle_codec)
else if (codec_id != AV_CODEC_ID_NONE &&
(codec_id == ofmt->video_codec ||
codec_id == ofmt->audio_codec ||
codec_id == ofmt->subtitle_codec))
return 1;
}
return AVERROR_PATCHWELCOME;