浏览代码

rtmp-services: Fix ingest update request user agent

The user agent for the obsproject.com ingest update request would have
the version string baked in to the plugin, so if the plugin library
wasn't updated with the rest of the project, it would return the
incorrect version.  This makes sure it returns the correct version by
requesting the version string from libobs itself.
jp9000 8 年之前
父节点
当前提交
3786a203c7
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      plugins/rtmp-services/rtmp-services-main.c

+ 7 - 1
plugins/rtmp-services/rtmp-services-main.c

@@ -44,11 +44,16 @@ bool obs_module_load(void)
 {
 	char *local_dir = obs_module_file("");
 	char *cache_dir = obs_module_config_path("");
+	struct dstr module_name = {0};
+
+	dstr_copy(&module_name, "rtmp-services plugin (libobs ");
+	dstr_cat(&module_name, obs_get_version_string());
+	dstr_cat(&module_name, ")");
 
 	if (cache_dir) {
 		update_info = update_info_create(
 				RTMP_SERVICES_LOG_STR,
-				RTMP_SERVICES_VER_STR,
+				module_name.array,
 				RTMP_SERVICES_URL,
 				local_dir,
 				cache_dir,
@@ -57,6 +62,7 @@ bool obs_module_load(void)
 
 	bfree(local_dir);
 	bfree(cache_dir);
+	dstr_free(&module_name);
 
 	obs_register_service(&rtmp_common_service);
 	obs_register_service(&rtmp_custom_service);