diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 4194ffa95..8ae5683c6 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 5.0 Changelog +* v5.0, 2023-02-08, Merge [#3391](https://github.com/ossrs/srs/pull/3391): Config: Error when both HLS and HTTP-TS enabled. v5.0.140 (#3391) * v5.0, 2023-01-29, Merge [#3371](https://github.com/ossrs/srs/pull/3371): HLS: support kick-off hls client. v5.0.139 (#3371) * v5.0, 2023-01-19, Merge [#3318](https://github.com/ossrs/srs/pull/3318): RTC: fix rtc publisher pli cid. v5.0.138 (#3318) * v5.0, 2023-01-18, Merge [#3382](https://github.com/ossrs/srs/pull/3382): Rewrite research/api-server code by Go, remove Python. v5.0.137 (#3382) diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 1167b316e..527e94d44 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -2674,6 +2674,59 @@ srs_error_t SrsConfig::check_normal_config() } } } + + //////////////////////////////////////////////////////////////////////// + // check HLS with HTTP-TS + //////////////////////////////////////////////////////////////////////// + for (int n = 0; n < (int)vhosts.size(); n++) { + SrsConfDirective* vhost = vhosts[n]; + + bool hls_enabled = false; + bool http_remux_ts = false; + int http_remux_cnt = 0; + + for (int i = 0; vhost && i < (int)vhost->directives.size(); i++) { + SrsConfDirective* conf = vhost->at(i); + string n = conf->name; + if (n == "http_remux") { + bool http_remux_enabled = false; + for (int j = 0; j < (int)conf->directives.size(); j++) { + string m = conf->at(j)->name; + + // http_remux enabled + if (m == "enabled" && conf->at(j)->arg0() == "on") { + http_remux_enabled = true; + } + + // check mount suffix '.ts' + if (http_remux_enabled && m == "mount" && srs_string_ends_with(conf->at(j)->arg0(), ".ts")) { + http_remux_ts = true; + } + } + http_remux_cnt++; + } else if (n == "hls") { + for (int j = 0; j < (int)conf->directives.size(); j++) { + string m = conf->at(j)->name; + + // hls enabled + if (m == "enabled" && conf->at(j)->arg0() == "on") { + hls_enabled = true; + } + } + } + } + + // check valid http-remux count + if (http_remux_cnt > 1) { + return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "vhost.http_remux only one but count=%d of %s", http_remux_cnt, vhost->arg0().c_str()); + } + + // check hls conflict with http-ts + if (hls_enabled && http_remux_ts) { + return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "vhost.hls conflict with vhost.http-ts of %s", vhost->arg0().c_str()); + } + } + // check ingest id unique. for (int i = 0; i < (int)vhosts.size(); i++) { SrsConfDirective* vhost = vhosts[i]; diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index ebdce60d4..502f91b68 100644 --- a/trunk/src/core/srs_core_version5.hpp +++ b/trunk/src/core/srs_core_version5.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 0 -#define VERSION_REVISION 139 +#define VERSION_REVISION 140 #endif