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 588658b39..856725075 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -617,6 +617,7 @@ if [[ $SRS_RTC == YES ]]; then ( 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 223ecf73c..d5f5aff3f 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -30,6 +30,9 @@ 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 * 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/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") diff --git a/trunk/src/app/srs_app_forward.cpp b/trunk/src/app/srs_app_forward.cpp index c72fe6506..d9af04e90 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 6956b133c..a6fd66fbb 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 190 #endif diff --git a/trunk/src/srt/srt_server.cpp b/trunk/src/srt/srt_server.cpp index cb3722f00..03fb16645 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; 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