From 85131dad63ac97264d76095ec70e67159653ef77 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 18 Oct 2021 15:10:05 +0800 Subject: [PATCH 1/2] Squash: Update SRS 4.0 version --- trunk/doc/CHANGELOG.md | 1 + trunk/src/core/srs_core_version4.hpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index cf8dfacd1..92f1419a2 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -29,6 +29,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2021-10-18, Merge [#2670](https://github.com/ossrs/srs/pull/2670): SRT: Solve mpegts demux assert bug. v4.0.180 * v4.0, 2021-10-16, Merge [#2665](https://github.com/ossrs/srs/pull/2665): API: Fix the same 'client_id' error when asynchronous call. v4.0.179 * v4.0, 2021-10-13, Merge [#2671](https://github.com/ossrs/srs/pull/2671): SRT: Pes error when mpegts demux in srt. v4.0.178 * v4.0, 2021-10-12, Merge [#2550](https://github.com/ossrs/srs/pull/2550): API use publish params. v4.0.177 diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 5c6cf93b9..985076342 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 179 +#define VERSION_REVISION 180 #endif From 9a017f4037cf43a6b7a81ce0b629478976942613 Mon Sep 17 00:00:00 2001 From: Matheus Macabu Date: Tue, 19 Oct 2021 02:20:28 +0200 Subject: [PATCH 2/2] RTMP: If port is explicity set to 0, use default 1935 (#1754) --- trunk/src/kernel/srs_kernel_utility.cpp | 4 ++-- trunk/src/utest/srs_utest_kernel.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/trunk/src/kernel/srs_kernel_utility.cpp b/trunk/src/kernel/srs_kernel_utility.cpp index a956bb3b6..8629bde9d 100644 --- a/trunk/src/kernel/srs_kernel_utility.cpp +++ b/trunk/src/kernel/srs_kernel_utility.cpp @@ -189,7 +189,7 @@ void srs_parse_hostport(string hostport, string& host, int& port) if (hostport.find(":") == pos) { host = hostport.substr(0, pos); string p = hostport.substr(pos + 1); - if (!p.empty()) { + if (!p.empty() && p != "0") { port = ::atoi(p.c_str()); } return; @@ -204,7 +204,7 @@ void srs_parse_hostport(string hostport, string& host, int& port) // For ipv6, [host]:port. host = hostport.substr(1, pos - 1); string p = hostport.substr(pos + 2); - if (!p.empty()) { + if (!p.empty() && p != "0") { port = ::atoi(p.c_str()); } } diff --git a/trunk/src/utest/srs_utest_kernel.cpp b/trunk/src/utest/srs_utest_kernel.cpp index b3ce712b8..cef48ea92 100644 --- a/trunk/src/utest/srs_utest_kernel.cpp +++ b/trunk/src/utest/srs_utest_kernel.cpp @@ -4570,6 +4570,14 @@ VOID TEST(KernelUtilityTest, CoverTimeUtilityAll) srs_parse_hostport("domain.com", host, port); EXPECT_STREQ("domain.com", host.c_str()); } + + if (true) { + string host; + int port = 1935; + srs_parse_hostport("domain.com:0", host, port); + EXPECT_EQ(1935, port); + EXPECT_STREQ("domain.com", host.c_str()); + } if (true) { string ep = srs_any_address_for_listener();