Jelajahi Sumber

UI: Remove compatibility with FFmpeg < 6.1

derrod 1 tahun lalu
induk
melakukan
3ebe071c7b
2 mengubah file dengan 2 tambahan dan 31 penghapusan
  1. 2 16
      UI/ffmpeg-utils.cpp
  2. 0 15
      UI/window-basic-main.cpp

+ 2 - 16
UI/ffmpeg-utils.cpp

@@ -100,12 +100,8 @@ bool FFCodecAndFormatCompatible(const char *codec, const char *format)
 	if (!codec || !format)
 		return false;
 
-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(59, 0, 100)
-	AVOutputFormat *output_format;
-#else
-	const AVOutputFormat *output_format;
-#endif
-	output_format = av_guess_format(format, nullptr, nullptr);
+	const AVOutputFormat *output_format =
+		av_guess_format(format, nullptr, nullptr);
 	if (!output_format)
 		return false;
 
@@ -114,13 +110,8 @@ bool FFCodecAndFormatCompatible(const char *codec, const char *format)
 	if (!codec_desc)
 		return false;
 
-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(60, 0, 100)
-	return avformat_query_codec(output_format, codec_desc->id,
-				    FF_COMPLIANCE_EXPERIMENTAL) == 1;
-#else
 	return avformat_query_codec(output_format, codec_desc->id,
 				    FF_COMPLIANCE_NORMAL) == 1;
-#endif
 }
 
 static const unordered_set<string> builtin_codecs = {
@@ -163,12 +154,9 @@ static const unordered_map<string, unordered_set<string>> codec_compat = {
 		 "opus",
 		 "alac",
 		 "flac",
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(60, 5, 100)
-		 // PCM in MP4 is only supported in FFmpeg > 6.0
 		 "pcm_s16le",
 		 "pcm_s24le",
 		 "pcm_f32le",
-#endif
 	 }},
 	{"fragmented_mp4",
 	 {
@@ -179,11 +167,9 @@ static const unordered_map<string, unordered_set<string>> codec_compat = {
 		 "opus",
 		 "alac",
 		 "flac",
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(60, 5, 100)
 		 "pcm_s16le",
 		 "pcm_s24le",
 		 "pcm_f32le",
-#endif
 	 }},
 	// Not part of FFmpeg, see obs-outputs module
 	{"hybrid_mp4",

+ 0 - 15
UI/window-basic-main.cpp

@@ -7698,26 +7698,11 @@ void OBSBasic::AutoRemux(QString input, bool no_show)
 	const char *format = config_get_string(
 		config, isSimpleMode ? "SimpleOutput" : "AdvOut", "RecFormat2");
 
-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(60, 5, 100)
-	const obs_encoder_t *audioEncoder =
-		obs_output_get_audio_encoder(outputHandler->fileOutput, 0);
-	const char *aCodecName = obs_encoder_get_codec(audioEncoder);
-	bool audio_is_pcm = strncmp(aCodecName, "pcm", 3) == 0;
-
-	/* FFmpeg <= 6.0 cannot remux AV1+PCM into any supported format. */
-	if (audio_is_pcm && strcmp(vCodecName, "av1") == 0)
-		return;
-#endif
-
 	/* Retain original container for fMP4/fMOV */
 	if (strncmp(format, "fragmented", 10) == 0) {
 		output += "remuxed." + suffix;
 	} else if (strcmp(vCodecName, "prores") == 0) {
 		output += "mov";
-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(60, 5, 100)
-	} else if (audio_is_pcm) {
-		output += "mov";
-#endif
 	} else {
 		output += "mp4";
 	}