rtmp-services: Require cmake var to enable ingest updates

Prevents an issue where forks would continually request data from the
obsproject server for ingest updates.
This commit is contained in:
jp9000 2017-08-09 12:34:27 -07:00
parent a625448d97
commit a4b361de00
3 changed files with 20 additions and 0 deletions

View File

@ -15,6 +15,7 @@ set(rtmp-services_HEADERS
set(RTMP_SERVICES_URL
"https://obsproject.com/obs2_update/rtmp-services"
CACHE STRING "Default services package URL")
option(CHECK_FOR_SERVICE_UPDATES "Checks for service updates" OFF)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/lookup-config.h.in"

View File

@ -1,3 +1,20 @@
#pragma once
#ifndef TRUE
#define TRUE 1
#endif
#ifndef ON
#define ON 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef OFF
#define OFF 0
#endif
#define RTMP_SERVICES_URL "@RTMP_SERVICES_URL@"
#define CHECK_FOR_SERVICE_UPDATES @CHECK_FOR_SERVICE_UPDATES@

View File

@ -48,6 +48,7 @@ bool obs_module_load(void)
{
init_twitch_data();
#if CHECK_FOR_SERVICE_UPDATES
char *local_dir = obs_module_file("");
char *cache_dir = obs_module_config_path("");
struct dstr module_name = {0};
@ -71,6 +72,7 @@ bool obs_module_load(void)
bfree(local_dir);
bfree(cache_dir);
dstr_free(&module_name);
#endif
obs_register_service(&rtmp_common_service);
obs_register_service(&rtmp_custom_service);