瀏覽代碼

obs-ffmpeg: Remove mpegts format override for SRT and RIST

FFmpeg is already very effective at detecting the correct input format
for socket-style protocols (SRT, RIST, TCP, UDP, etc.). By overriding
the format of SRT and RIST manually to mpegts, the user is being
prevented from using other container formats via these protocols.

In the rare case that libavformat is unable to detect the correct
container format for an SRT or RIST stream, the user may manually
specify that format in the existing format field.

With the FFmpeg options field which was recently added, probe options
may be specified by the user to further tune format detection.
tt2468 2 年之前
父節點
當前提交
3d30a4efea
共有 1 個文件被更改,包括 0 次插入11 次删除
  1. 0 11
      plugins/obs-ffmpeg/obs-ffmpeg-source.c

+ 0 - 11
plugins/obs-ffmpeg/obs-ffmpeg-source.c

@@ -425,15 +425,8 @@ static void ffmpeg_source_tick(void *data, float seconds)
 	}
 }
 
-#define SRT_PROTO "srt"
 #define RIST_PROTO "rist"
 
-static bool requires_mpegts(const char *path)
-{
-	return !astrcmpi_n(path, SRT_PROTO, sizeof(SRT_PROTO) - 1) ||
-	       !astrcmpi_n(path, RIST_PROTO, sizeof(RIST_PROTO) - 1);
-}
-
 static void ffmpeg_source_update(void *data, obs_data_t *settings)
 {
 	struct ffmpeg_source *s = data;
@@ -468,10 +461,6 @@ static void ffmpeg_source_update(void *data, obs_data_t *settings)
 		should_restart_media = true;
 		input = obs_data_get_string(settings, "input");
 		input_format = obs_data_get_string(settings, "input_format");
-		if (requires_mpegts(input)) {
-			input_format = "mpegts";
-			obs_data_set_string(settings, "input_format", "mpegts");
-		}
 		s->reconnect_delay_sec =
 			(int)obs_data_get_int(settings, "reconnect_delay_sec");
 		s->reconnect_delay_sec = s->reconnect_delay_sec == 0