diff --git a/plugins/rtmp-services/rtmp-custom.c b/plugins/rtmp-services/rtmp-custom.c index 921be2fe3..6879eb99c 100644 --- a/plugins/rtmp-services/rtmp-custom.c +++ b/plugins/rtmp-services/rtmp-custom.c @@ -1,4 +1,5 @@ #include +#include struct rtmp_custom { char *server, *key; @@ -109,6 +110,19 @@ static const char *rtmp_custom_password(void *data) return service->password; } +#define RTMP_PROTOCOL "rtmp" + +static void rtmp_custom_apply_settings(void *data, obs_data_t *video_settings, + obs_data_t *audio_settings) +{ + struct rtmp_custom *service = data; + if (service->server != NULL && video_settings != NULL && + strncmp(service->server, RTMP_PROTOCOL, strlen(RTMP_PROTOCOL)) != + 0) { + obs_data_set_bool(video_settings, "repeat_headers", true); + } +} + struct obs_service_info rtmp_custom_service = { .id = "rtmp_custom", .get_name = rtmp_custom_name, @@ -120,4 +134,5 @@ struct obs_service_info rtmp_custom_service = { .get_key = rtmp_custom_key, .get_username = rtmp_custom_username, .get_password = rtmp_custom_password, + .apply_encoder_settings = rtmp_custom_apply_settings, };