From 8125dd4dd1f639d76a282c566556efb271a994e8 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 30 Oct 2021 07:59:57 +0800 Subject: [PATCH 1/5] Forward: Fast quit when cycle fail. v4.0.188 (#2284) --- trunk/doc/CHANGELOG.md | 1 + trunk/src/app/srs_app_forward.cpp | 6 ++++++ trunk/src/core/srs_core_version4.hpp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index a568386eb..e4f3f0ff8 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2021-10-30, Merge [#2284](https://github.com/ossrs/srs/pull/2284): Forward: Fast quit when cycle fail. v4.0.188 * v4.0, 2021-10-28, Merge [#2186](https://github.com/ossrs/srs/pull/2186): Gop: Ignore zero timestamp when shrinking. v4.0.187 * v4.0, 2021-10-27, Merge [#1963](https://github.com/ossrs/srs/pull/1963): Cluster: Origin server shouldn't be it's own coworker. v4.0.186 * v4.0, 2021-10-25, Merge [#2692](https://github.com/ossrs/srs/pull/2692): API: Add server_id into http_hooks. v4.0.185 diff --git a/trunk/src/app/srs_app_forward.cpp b/trunk/src/app/srs_app_forward.cpp index 0bad6bce5..06cfd118c 100755 --- a/trunk/src/app/srs_app_forward.cpp +++ b/trunk/src/app/srs_app_forward.cpp @@ -175,6 +175,12 @@ srs_error_t SrsForwarder::cycle() srs_freep(err); } + // Never wait if thread error, fast quit. + // @see https://github.com/ossrs/srs/pull/2284 + if ((err = trd->pull()) != srs_success) { + return srs_error_wrap(err, "forwarder"); + } + srs_usleep(SRS_FORWARDER_CIMS); } diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 9b733cf82..4a9b70d90 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 187 +#define VERSION_REVISION 188 #endif From cc99226ed5e5334a49e4eb1223baa15fa43d0a87 Mon Sep 17 00:00:00 2001 From: HungMingWu Date: Sat, 30 Oct 2021 08:40:25 +0800 Subject: [PATCH 2/5] SRTP: Patch libsrtp2 to fix GCC10 build fail. v4.0.189 --- trunk/3rdparty/patches/srtp/gcc10-01.patch | 4 ++++ trunk/auto/depends.sh | 1 + trunk/doc/CHANGELOG.md | 1 + trunk/src/core/srs_core_version4.hpp | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 trunk/3rdparty/patches/srtp/gcc10-01.patch diff --git a/trunk/3rdparty/patches/srtp/gcc10-01.patch b/trunk/3rdparty/patches/srtp/gcc10-01.patch new file mode 100644 index 000000000..cd9fa2f3d --- /dev/null +++ b/trunk/3rdparty/patches/srtp/gcc10-01.patch @@ -0,0 +1,4 @@ +82c82 +< char bit_string[MAX_PRINT_STRING_LEN]; +--- +> static char bit_string[MAX_PRINT_STRING_LEN]; diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index 1fb18643f..0cd3106ef 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -608,6 +608,7 @@ else ( rm -rf ${SRS_OBJS}/srtp2 && cd ${SRS_OBJS}/${SRS_PLATFORM} && rm -rf libsrtp-2-fit && cp -R ../../3rdparty/libsrtp-2-fit . && cd libsrtp-2-fit && + patch -p0 crypto/math/datatypes.c ../../../3rdparty/patches/srtp/gcc10-01.patch && $SRTP_CONFIGURE ${SRTP_OPTIONS} --prefix=`pwd`/_release && make ${SRS_JOBS} && make install && cd .. && rm -rf srtp2 && ln -sf libsrtp-2-fit/_release srtp2 diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index e4f3f0ff8..a0a532c1f 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2021-10-30, Merge [#2397](https://github.com/ossrs/srs/pull/2397): SRTP: Patch libsrtp2 to fix GCC10 build fail. v4.0.189 * v4.0, 2021-10-30, Merge [#2284](https://github.com/ossrs/srs/pull/2284): Forward: Fast quit when cycle fail. v4.0.188 * v4.0, 2021-10-28, Merge [#2186](https://github.com/ossrs/srs/pull/2186): Gop: Ignore zero timestamp when shrinking. v4.0.187 * v4.0, 2021-10-27, Merge [#1963](https://github.com/ossrs/srs/pull/1963): Cluster: Origin server shouldn't be it's own coworker. v4.0.186 diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 4a9b70d90..02549b6c9 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 188 +#define VERSION_REVISION 189 #endif From b9288668a7d83e21c2ce3002130ffd79ddfbe890 Mon Sep 17 00:00:00 2001 From: Abrar Ahmed <13979201+abrar71@users.noreply.github.com> Date: Thu, 1 Jul 2021 16:28:35 +0500 Subject: [PATCH 3/5] SRT: Type from shoulde to should. (#2455) Change word typo from shoulde to should --- trunk/src/srt/srt_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trunk/src/srt/srt_server.cpp b/trunk/src/srt/srt_server.cpp index f09f919b7..336fdfa99 100644 --- a/trunk/src/srt/srt_server.cpp +++ b/trunk/src/srt/srt_server.cpp @@ -229,7 +229,7 @@ void srt_server::srt_handle_connection(SRT_SOCKSTATUS status, SRTSOCKET input_fd } else if (srt_conn_ptr->get_mode() == PUSH_SRT_MODE) { conn_event = SRT_EPOLL_IN | SRT_EPOLL_ERR; } else { - srt_log_trace("stream mode error, it shoulde be m=push or m=pull, streamid:%s", + srt_log_trace("stream mode error, it should be m=push or m=pull, streamid:%s", srt_conn_ptr->get_streamid().c_str()); srt_conn_ptr->close(); return; From 54b706d36efeb7b3a487dd4d17b5778a045d7fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=96=87=E6=AD=A6?= Date: Tue, 24 Aug 2021 16:33:09 +0800 Subject: [PATCH 4/5] Script: Refine CentOS7 service script to restart SRS. v4.0.190 (#2552) --- trunk/doc/CHANGELOG.md | 1 + trunk/src/core/srs_core_version4.hpp | 2 +- trunk/usr/lib/systemd/system/srs.service | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index a0a532c1f..47626038a 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2021-10-30, Merge [#2552](https://github.com/ossrs/srs/pull/2552): Script: Refine CentOS7 service script to restart SRS. v4.0.190 * v4.0, 2021-10-30, Merge [#2397](https://github.com/ossrs/srs/pull/2397): SRTP: Patch libsrtp2 to fix GCC10 build fail. v4.0.189 * v4.0, 2021-10-30, Merge [#2284](https://github.com/ossrs/srs/pull/2284): Forward: Fast quit when cycle fail. v4.0.188 * v4.0, 2021-10-28, Merge [#2186](https://github.com/ossrs/srs/pull/2186): Gop: Ignore zero timestamp when shrinking. v4.0.187 diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 02549b6c9..891b0e99f 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 189 +#define VERSION_REVISION 190 #endif diff --git a/trunk/usr/lib/systemd/system/srs.service b/trunk/usr/lib/systemd/system/srs.service index b76bc930a..0a27b9a96 100644 --- a/trunk/usr/lib/systemd/system/srs.service +++ b/trunk/usr/lib/systemd/system/srs.service @@ -4,6 +4,7 @@ After=network.target [Service] Type=forking +Restart=always ExecStart=/etc/init.d/srs start ExecReload=/etc/init.d/srs reload ExecStop=/etc/init.d/srs stop From 60ab81a5c7d76ee67b7a776e8368a2f268092353 Mon Sep 17 00:00:00 2001 From: qingfuliao <45161976+qingfuliao@users.noreply.github.com> Date: Sat, 30 Oct 2021 12:12:06 +0800 Subject: [PATCH 5/5] IDE: Fix build problem caused by ffmpeg/pthread dependency. (#2579) --- trunk/ide/srs_clion/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trunk/ide/srs_clion/CMakeLists.txt b/trunk/ide/srs_clion/CMakeLists.txt index 6c736d598..1108fb66a 100755 --- a/trunk/ide/srs_clion/CMakeLists.txt +++ b/trunk/ide/srs_clion/CMakeLists.txt @@ -25,9 +25,9 @@ set(DEPS_LIBS ${SRS_DIR}/objs/st/libst.a ${SRS_DIR}/objs/openssl/lib/libssl.a ${SRS_DIR}/objs/openssl/lib/libcrypto.a ${SRS_DIR}/objs/srtp2/lib/libsrtp2.a - ${SRS_DIR}/objs/opus/lib/libopus.a - ${SRS_DIR}/objs/ffmpeg/lib/libavutil.a ${SRS_DIR}/objs/ffmpeg/lib/libavcodec.a + ${SRS_DIR}/objs/ffmpeg/lib/libavutil.a + ${SRS_DIR}/objs/opus/lib/libopus.a ${SRS_DIR}/objs/ffmpeg/lib/libswresample.a) foreach(DEPS_LIB ${DEPS_LIBS}) IF (NOT EXISTS ${DEPS_LIB}) @@ -62,7 +62,7 @@ ADD_DEFINITIONS("-g -O0") ADD_EXECUTABLE(srs ${SOURCE_FILES}) TARGET_LINK_LIBRARIES(srs dl) TARGET_LINK_LIBRARIES(srs ${DEPS_LIBS}) -TARGET_LINK_LIBRARIES(srs -ldl) +TARGET_LINK_LIBRARIES(srs -ldl -pthread) MESSAGE(STATUS "@see https://github.com/ossrs/srs/wiki/v4_CN_IDE")