mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-02 09:33:33 +00:00
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.
This commit is contained in:
parent
15b5dae9c2
commit
3d30a4efea
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue