From 74154cdfd9d77970a146376135f48fbd417381e9 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 25 Jan 2020 18:05:18 +0800 Subject: [PATCH 1/9] Fix #703, drop video data util sps/pps. 3.0.107 --- README.md | 2 ++ trunk/src/app/srs_app_source.cpp | 6 ++++++ trunk/src/core/srs_core.hpp | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0cf323d5..b06470dfa 100755 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-01-25, Fix [#703][bug #703], drop video data util sps/pps. 3.0.107 * v3.0, 2020-01-25, Fix [#1108][bug #1108], reap DVR tmp file when unpublish. 3.0.106 * v3.0, 2020-01-21, [3.0 alpha9(3.0.105)][r3.0a9] released. 121577 lines. * v3.0, 2020-01-21, Fix [#1221][bug #1221], remove complex configure options. 3.0.104 @@ -1612,6 +1613,7 @@ Winlin [bug #1547]: https://github.com/ossrs/srs/issues/1547 [bug #1221]: https://github.com/ossrs/srs/issues/1221 [bug #1108]: https://github.com/ossrs/srs/issues/1108 +[bug #703]: https://github.com/ossrs/srs/issues/703 [bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index f48528015..dd42b5590 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -1047,6 +1047,12 @@ srs_error_t SrsOriginHub::on_video(SrsSharedPtrMessage* shared_video, bool is_se srs_avc_level2str(c->avc_level).c_str(), c->width, c->height, c->video_data_rate / 1000, c->frame_rate, c->duration); } + + // Ignore video data when no sps/pps + // @bug https://github.com/ossrs/srs/issues/703#issuecomment-578393155 + if (format->vcodec && !format->vcodec->is_avc_codec_ok()) { + return err; + } if ((err = hls->on_video(msg, format)) != srs_success) { // apply the error strategy for hls. diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 2bca91cdf..5cd01df38 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -27,7 +27,7 @@ // The version config. #define VERSION_MAJOR 3 #define VERSION_MINOR 0 -#define VERSION_REVISION 106 +#define VERSION_REVISION 107 // The macros generated by configure script. #include From 2775a391e0b693a0b999d0f2bc8c700eb1a41fd5 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 25 Jan 2020 20:03:22 +0800 Subject: [PATCH 2/9] Fix #878, remove deprecated #EXT-X-ALLOW-CACHE for HLS. 3.0.108 --- README.md | 2 ++ trunk/conf/full.conf | 2 +- trunk/src/app/srs_app_hls.cpp | 6 ++---- trunk/src/core/srs_core.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b06470dfa..1baf02911 100755 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-01-25, Fix [#878][bug #878], remove deprecated #EXT-X-ALLOW-CACHE for HLS. 3.0.108 * v3.0, 2020-01-25, Fix [#703][bug #703], drop video data util sps/pps. 3.0.107 * v3.0, 2020-01-25, Fix [#1108][bug #1108], reap DVR tmp file when unpublish. 3.0.106 * v3.0, 2020-01-21, [3.0 alpha9(3.0.105)][r3.0a9] released. 121577 lines. @@ -1614,6 +1615,7 @@ Winlin [bug #1221]: https://github.com/ossrs/srs/issues/1221 [bug #1108]: https://github.com/ossrs/srs/issues/1108 [bug #703]: https://github.com/ossrs/srs/issues/703 +[bug #878]: https://github.com/ossrs/srs/issues/878 [bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index 1160877a4..890b1c000 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -196,7 +196,7 @@ stream_caster { # the caster type of stream, the casters: # mpegts_over_udp, MPEG-TS over UDP caster. # rtsp, Real Time Streaming Protocol (RTSP). - # flv, FLV over HTTP POST. + # flv, FLV over HTTP by POST. caster mpegts_over_udp; # the output rtmp url. # for mpegts_over_udp caster, the typically output url: diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index 72ec535ca..7470acf2a 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -751,11 +751,9 @@ srs_error_t SrsHlsMuxer::_refresh_m3u8(string m3u8_file) // #EXTM3U\n // #EXT-X-VERSION:3\n - // #EXT-X-ALLOW-CACHE:YES\n std::stringstream ss; - ss << "#EXTM3U" << SRS_CONSTS_LF - << "#EXT-X-VERSION:3" << SRS_CONSTS_LF - << "#EXT-X-ALLOW-CACHE:YES" << SRS_CONSTS_LF; + ss << "#EXTM3U" << SRS_CONSTS_LF; + ss << "#EXT-X-VERSION:3" << SRS_CONSTS_LF; // #EXT-X-MEDIA-SEQUENCE:4294967295\n SrsHlsSegment* first = dynamic_cast(segments->first()); diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 5cd01df38..eb575ba5a 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -27,7 +27,7 @@ // The version config. #define VERSION_MAJOR 3 #define VERSION_MINOR 0 -#define VERSION_REVISION 107 +#define VERSION_REVISION 108 // The macros generated by configure script. #include From fe78c75b0f29bdc0c3683569c7a13fdfaae7137a Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 26 Jan 2020 09:25:44 +0800 Subject: [PATCH 3/9] Fix #607, set RTMP identifying recursive depth to 3. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1baf02911..1aa7e9327 100755 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-01-26, Fix [#607][bug #607], set RTMP identifying recursive depth to 3. * v3.0, 2020-01-25, Fix [#878][bug #878], remove deprecated #EXT-X-ALLOW-CACHE for HLS. 3.0.108 * v3.0, 2020-01-25, Fix [#703][bug #703], drop video data util sps/pps. 3.0.107 * v3.0, 2020-01-25, Fix [#1108][bug #1108], reap DVR tmp file when unpublish. 3.0.106 @@ -1616,6 +1617,7 @@ Winlin [bug #1108]: https://github.com/ossrs/srs/issues/1108 [bug #703]: https://github.com/ossrs/srs/issues/703 [bug #878]: https://github.com/ossrs/srs/issues/878 +[bug #607]: https://github.com/ossrs/srs/issues/607 [bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 From 4b1108c821826abad1feeb8bbc25bab83dd68901 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 26 Jan 2020 14:14:29 +0800 Subject: [PATCH 4/9] How to speedup clone --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 1aa7e9327..50c15fc88 100755 --- a/README.md +++ b/README.md @@ -1108,6 +1108,15 @@ Gitlab: [https://gitlab.com/winlinvip/srs-gitlab][gitlab], the GIT usage([CN][v1 git clone https://gitlab.com/winlinvip/srs-gitlab.git ``` +| Branch | Cost | Size | CMD | +| --- | --- | --- | --- | +| 3.0release | 2m19.931s | 262MB | git clone -b 3.0release https://gitee.com/winlinvip/srs.oschina.git | +| 3.0release | 0m56.515s | 95MB | git clone -b 3.0release --depth=1 https://gitee.com/winlinvip/srs.oschina.git | +| develop | 2m22.430s | 234MB | git clone -b develop https://gitee.com/winlinvip/srs.oschina.git | +| develop | 0m46.421s | 42MB | git clone -b develop --depth=1 https://gitee.com/winlinvip/srs.oschina.git | +| min | 2m22.865s | 217MB | git clone -b min https://gitee.com/winlinvip/srs.oschina.git | +| min | 0m36.472s | 11MB | git clone -b min --depth=1 https://gitee.com/winlinvip/srs.oschina.git | + ## System Requirements Supported operating systems and hardware: From 7460729c0ec5bca0bac55a9221f213ef26631103 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 26 Jan 2020 14:16:50 +0800 Subject: [PATCH 5/9] Update readme --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 50c15fc88..a496e4a73 100755 --- a/README.md +++ b/README.md @@ -776,7 +776,7 @@ Comparing with other media servers, SRS is much better and stronger, for details **Stream Delivery** -| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA | +| Feature | SRS | NGINX | CRTMPD | AMS | WOWZA | | ----------- | ------- | ----- | --------- | -------- | ------ | | RTMP | Stable | Stable | Stable | Stable | Stable | | HLS | Stable | Stable | X | Stable | Stable | @@ -789,7 +789,7 @@ Comparing with other media servers, SRS is much better and stronger, for details **Cluster** -| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA | +| Feature | SRS | NGINX | CRTMPD | AMS | WOWZA | | ----------- | ------- | ----- | --------- | -------- | ------ | | RTMP Edge | Stable | X | X | Stable | X | | RTMP Backup | Stable | X | X | X | X | @@ -802,7 +802,7 @@ Comparing with other media servers, SRS is much better and stronger, for details **Stream Service** -| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA | +| Feature | SRS | NGINX | CRTMPD | AMS | WOWZA | | ----------- | ------- | ----- | --------- | -------- | ------ | | DVR | Stable | Stable | X | X | Stable | | DVR API | Stable | Stable | X | X | X | @@ -819,7 +819,7 @@ Comparing with other media servers, SRS is much better and stronger, for details **Efficiency** -| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA | +| Feature | SRS | NGINX | CRTMPD | AMS | WOWZA | | ----------- | ------- | ----- | --------- | -------- | ------ | | Concurrency | 7.5k | 3k | 2k | 2k | 3k | |MultipleProcess| Experiment| Stable | X | X | X | @@ -829,7 +829,7 @@ Comparing with other media servers, SRS is much better and stronger, for details **Stream Caster** -| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA | +| Feature | SRS | NGINX | CRTMPD | AMS | WOWZA | | ----------- | ------- | ----- | --------- | -------- | ------ | | Ingest | Stable | X | X | X | X | | Push MPEGTS | Experiment| X | X | X | Stable | @@ -839,7 +839,7 @@ Comparing with other media servers, SRS is much better and stronger, for details **Debug System** -| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA | +| Feature | SRS | NGINX | CRTMPD | AMS | WOWZA | | ----------- | ------- | ----- | --------- | -------- | ------ | | BW check | Stable | X | X | X | X | | Tracable Log | Stable | X | X | X | X | @@ -847,7 +847,7 @@ Comparing with other media servers, SRS is much better and stronger, for details **Docs** -| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA | +| Feature | SRS | NGINX | CRTMPD | AMS | WOWZA | | ----------- | ------- | ----- | --------- | -------- | ------ | | Demos | Stable | X | X | X | X | | WIKI(EN+CN) | Stable | EN only | X | X | Stable | @@ -855,7 +855,7 @@ Comparing with other media servers, SRS is much better and stronger, for details **Others** -| Feature | SRS | NGINX | CRTMPD | FMS | WOWZA | +| Feature | SRS | NGINX | CRTMPD | AMS | WOWZA | | ----------- | ------- | ----- | --------- | -------- | ------ | | ARM/MIPS | Stable | Stable | X | X | X | | Client Library| Stable | X | X | X | X | From d5c15462373a660cf496062a127b7859e2fdddd4 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 26 Jan 2020 14:37:59 +0800 Subject: [PATCH 6/9] Update doc for SRT --- trunk/doc/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/trunk/doc/README.md b/trunk/doc/README.md index 49a765648..29ee7b926 100644 --- a/trunk/doc/README.md +++ b/trunk/doc/README.md @@ -37,6 +37,12 @@ 1. [ICE, rfc5245-2010-ice.pdf](http://github.com/ossrs/srs/wiki/doc/rfc5245-2010-ice.pdf): https://tools.ietf.org/html/rfc5245 1. [SIP, rfc3261-2002-sip.pdf](http://github.com/ossrs/srs/wiki/doc/rfc3261-2002-sip.pdf): https://tools.ietf.org/html/rfc3261 +## SRT + +1. [Haivision_SRT_Open_Source_White_Paper.pdf](http://github.com/ossrs/srs/wiki/doc/Haivision_SRT_Open_Source_White_Paper.pdf) +1. [SRT_Alliance_Deployment_Guide.pdf](http://github.com/ossrs/srs/wiki/doc/SRT_Alliance_Deployment_Guide.pdf) +1. [SRT_Protocol_TechnicalOverview_DRAFT_2018-10-17.pdf](http://github.com/ossrs/srs/wiki/doc/SRT_Protocol_TechnicalOverview_DRAFT_2018-10-17.pdf) + ## Others 1. [kafka-160915-0553-82964.pdf](http://github.com/ossrs/srs/wiki/doc/kafka-160915-0553-82964.pdf), https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol From 01870cce561841099a25c2b393ae7c96a22d0fa5 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 26 Jan 2020 17:33:10 +0800 Subject: [PATCH 7/9] Allow use libst.so for ST is MPL license. --- README.md | 1 + trunk/auto/depends.sh | 4 ++-- trunk/auto/options.sh | 6 ++++++ trunk/auto/utest.sh | 6 +++++- trunk/configure | 1 + 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a496e4a73..cea746070 100755 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-01-26, Allow use libst.so for ST is MPL license. * v3.0, 2020-01-26, Fix [#607][bug #607], set RTMP identifying recursive depth to 3. * v3.0, 2020-01-25, Fix [#878][bug #878], remove deprecated #EXT-X-ALLOW-CACHE for HLS. 3.0.108 * v3.0, 2020-01-25, Fix [#703][bug #703], drop video data util sps/pps. 3.0.107 diff --git a/trunk/auto/depends.sh b/trunk/auto/depends.sh index bf183c0a6..d89749d58 100755 --- a/trunk/auto/depends.sh +++ b/trunk/auto/depends.sh @@ -329,7 +329,7 @@ fi # Affected users should upgrade to OpenSSL 1.1.0e. Users unable to immediately # upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS. if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then - OPENSSL_HOTFIX="-DOPENSSL_NO_HEARTBEATS" + OPENSSL_OPTIONS="-no-shared -no-threads -no-asm -DOPENSSL_NO_HEARTBEATS" OPENSSL_CONFIG="./config" # https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain if [[ $SRS_CROSS_BUILD == YES ]]; then @@ -351,7 +351,7 @@ if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then ( rm -rf ${SRS_OBJS}/openssl-1.1.0e && cd ${SRS_OBJS} && unzip -q ../3rdparty/openssl-1.1.0e.zip && cd openssl-1.1.0e && - ${OPENSSL_CONFIG} --prefix=`pwd`/_release -no-shared -no-threads -no-asm $OPENSSL_HOTFIX && + ${OPENSSL_CONFIG} --prefix=`pwd`/_release $OPENSSL_OPTIONS && make CC=${SRS_TOOL_CC} AR="${SRS_TOOL_AR} -rs" LD=${SRS_TOOL_LD} RANDLIB=${SRS_TOOL_RANDLIB} && make install_sw && cd .. && rm -rf openssl && ln -sf openssl-1.1.0e/_release openssl ) diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 8e9fae371..7bf4f209c 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -47,6 +47,8 @@ SRS_FFMPEG_STUB=NO SRS_PREFIX=/usr/local/srs SRS_JOBS=1 SRS_STATIC=NO +# If enabled, link shared libraries for libst.so which uses MPL license. +SRS_SHARED_ST=NO # whether enable the gcov SRS_GCOV=NO # whether enable the log verbose/info/trace level. @@ -180,6 +182,7 @@ Conflicts: Experts: --use-sys-ssl Do not compile ssl, use system ssl(-lssl) if required. + --use-shared-st Use link shared libraries for ST which uses MPL license. --export-librtmp-project= Export srs-librtmp to specified project in path. --export-librtmp-single= Export srs-librtmp to a single file(.h+.cpp) in path. @@ -267,6 +270,8 @@ function parse_user_option() { --full) SRS_ENABLE_ALL=YES ;; --use-sys-ssl) SRS_USE_SYS_SSL=YES ;; + --use-shared-st) SRS_SHARED_ST=YES ;; + --memory-watch) SRS_MEM_WATCH=YES ;; --export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;; --export-librtmp-single) SRS_EXPORT_LIBRTMP_SINGLE=${value} ;; @@ -529,6 +534,7 @@ SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}" if [ $SRS_GPERF_CP = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gcp"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gcp"; fi if [ $SRS_GPROF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi + if [ $SRS_SHARED_ST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --use-shared-st"; fi if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi diff --git a/trunk/auto/utest.sh b/trunk/auto/utest.sh index 18b4978cd..1255e35a7 100755 --- a/trunk/auto/utest.sh +++ b/trunk/auto/utest.sh @@ -167,7 +167,11 @@ echo "" >> ${FILE} echo "# link all depends libraries" >> ${FILE} echo -n "DEPS_LIBRARIES_FILES = " >> ${FILE} for item in ${ModuleLibFiles[*]}; do - echo -n "${SRS_TRUNK_PREFIX}/${item} " >> ${FILE} + if [[ -f ${item} ]]; then + echo -n "${SRS_TRUNK_PREFIX}/${item} " >> ${FILE} + else + echo -n "${item} " >> ${FILE} + fi done echo "" >> ${FILE}; echo "" >> ${FILE} # diff --git a/trunk/configure b/trunk/configure index d09ebc09e..2441dbb07 100755 --- a/trunk/configure +++ b/trunk/configure @@ -144,6 +144,7 @@ END # # st(state-threads) the basic network library for SRS. LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a" +if [[ $SRS_SHARED_ST == YES ]]; then LibSTfile="-lst"; fi # openssl-1.1.0e, for the RTMP complex handshake. LibSSLRoot="";LibSSLfile="" if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == NO ]]; then From d9bbd97d7265889c5c6dbc71e8c53620e12ac7b0 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 26 Jan 2020 17:41:05 +0800 Subject: [PATCH 8/9] Allow use libsrt.so for SRT is MPL license. --- README.md | 1 + trunk/auto/options.sh | 5 +++++ trunk/configure | 1 + trunk/src/core/srs_core.hpp | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d193eda3..ac4c9c136 100755 --- a/README.md +++ b/README.md @@ -153,6 +153,7 @@ For previous versions, please read: ## V4 changes +* v4.0, 2020-01-26, Allow use libsrt.so for SRT is MPL license. 4.0.2 * v4.0, 2020-01-24, Fix [#1147][bug #1147], support SRT(Secure Reliable Transport). 4.0.1 ## V3 changes diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index d1f769006..8c7cdae51 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -50,6 +50,8 @@ SRS_JOBS=1 SRS_STATIC=NO # If enabled, link shared libraries for libst.so which uses MPL license. SRS_SHARED_ST=NO +# If enabled, link shared libraries for libsrt.so which uses MPL license. +SRS_SHARED_SRT=NO # whether enable the gcov SRS_GCOV=NO # whether enable the log verbose/info/trace level. @@ -186,6 +188,7 @@ Conflicts: Experts: --use-sys-ssl Do not compile ssl, use system ssl(-lssl) if required. --use-shared-st Use link shared libraries for ST which uses MPL license. + --use-shared-srt Use link shared libraries for SRT which uses MPL license. --export-librtmp-project= Export srs-librtmp to specified project in path. --export-librtmp-single= Export srs-librtmp to a single file(.h+.cpp) in path. @@ -276,6 +279,7 @@ function parse_user_option() { --use-sys-ssl) SRS_USE_SYS_SSL=YES ;; --use-shared-st) SRS_SHARED_ST=YES ;; + --use-shared-srt) SRS_SHARED_SRT=YES ;; --memory-watch) SRS_MEM_WATCH=YES ;; --export-librtmp-project) SRS_EXPORT_LIBRTMP_PROJECT=${value} ;; @@ -541,6 +545,7 @@ function regenerate_options() { if [ $SRS_GPROF = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --with-gprof"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --without-gprof"; fi if [ $SRS_STATIC = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --static"; fi if [ $SRS_SHARED_ST = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --use-shared-st"; fi + if [ $SRS_SHARED_SRT = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --use-shared-srt"; fi if [ $SRS_LOG_VERBOSE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-verbose"; fi if [ $SRS_LOG_INFO = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-info"; fi if [ $SRS_LOG_TRACE = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --log-trace"; fi diff --git a/trunk/configure b/trunk/configure index 843d18376..2f65cbbe2 100755 --- a/trunk/configure +++ b/trunk/configure @@ -164,6 +164,7 @@ fi # srt code path if [[ $SRS_SRT == YES ]]; then LibSRTRoot="${SRS_WORKDIR}/src/srt"; LibSRTfile="${SRS_OBJS_DIR}/srt/lib/libsrt.a" + if [[ $SRS_SHARED_SRT == YES ]]; then LibSRTfile="-lsrt"; fi fi # the link options, always use static link SrsLinkOptions="-ldl"; diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index d1febe177..0f8f8c3c7 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -27,7 +27,7 @@ // The version config. #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 1 +#define VERSION_REVISION 2 // The macros generated by configure script. #include From 5d365bade862d121cad780aa57657bef5ed1d3e0 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 27 Jan 2020 19:46:08 +0800 Subject: [PATCH 9/9] Fix #1303, do not dispatch previous meta when not publishing. 3.0.109 --- README.md | 2 ++ trunk/src/app/srs_app_source.cpp | 36 +++++++++++++++++++------------- trunk/src/app/srs_app_source.hpp | 5 +++-- trunk/src/core/srs_core.hpp | 2 +- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index cea746070..1e27dcf5b 100755 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-01-27, Fix [#1303][bug #1303], do not dispatch previous meta when not publishing. 3.0.109 * v3.0, 2020-01-26, Allow use libst.so for ST is MPL license. * v3.0, 2020-01-26, Fix [#607][bug #607], set RTMP identifying recursive depth to 3. * v3.0, 2020-01-25, Fix [#878][bug #878], remove deprecated #EXT-X-ALLOW-CACHE for HLS. 3.0.108 @@ -1628,6 +1629,7 @@ Winlin [bug #703]: https://github.com/ossrs/srs/issues/703 [bug #878]: https://github.com/ossrs/srs/issues/878 [bug #607]: https://github.com/ossrs/srs/issues/607 +[bug #1303]: https://github.com/ossrs/srs/issues/1303 [bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index dd42b5590..3bf9e0c65 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -903,6 +903,11 @@ srs_error_t SrsOriginHub::cycle() return err; } +bool SrsOriginHub::active() +{ + return is_active; +} + srs_error_t SrsOriginHub::on_meta_data(SrsSharedPtrMessage* shared_metadata, SrsOnMetaDataPacket* packet) { srs_error_t err = srs_success; @@ -2458,10 +2463,10 @@ srs_error_t SrsSource::create_consumer(SrsConnection* conn, SrsConsumer*& consum consumer = new SrsConsumer(this, conn); consumers.push_back(consumer); - + srs_utime_t queue_size = _srs_config->get_queue_length(req->vhost); consumer->set_queue_size(queue_size); - + // if atc, update the sequence header to gop cache time. if (atc && !gop_cache->empty()) { if (meta->data()) { @@ -2474,22 +2479,25 @@ srs_error_t SrsSource::create_consumer(SrsConnection* conn, SrsConsumer*& consum meta->ash()->timestamp = srsu2ms(gop_cache->start_time()); } } - - // Copy metadata and sequence header to consumer. - if ((err = meta->dumps(consumer, atc, jitter_algorithm, dm, ds)) != srs_success) { - return srs_error_wrap(err, "meta dumps"); + + // If stream is publishing, dumps the sequence header and gop cache. + if (hub->active()) { + // Copy metadata and sequence header to consumer. + if ((err = meta->dumps(consumer, atc, jitter_algorithm, dm, ds)) != srs_success) { + return srs_error_wrap(err, "meta dumps"); + } + + // copy gop cache to client. + if (dg && (err = gop_cache->dump(consumer, atc, jitter_algorithm)) != srs_success) { + return srs_error_wrap(err, "gop cache dumps"); + } } - - // copy gop cache to client. - if (dg && (err = gop_cache->dump(consumer, atc, jitter_algorithm)) != srs_success) { - return srs_error_wrap(err, "gop cache dumps"); - } - + // print status. if (dg) { - srs_trace("create consumer, queue_size=%.2f, jitter=%d", queue_size, jitter_algorithm); + srs_trace("create consumer, active=%d, queue_size=%.2f, jitter=%d", hub->active(), queue_size, jitter_algorithm); } else { - srs_trace("create consumer, ignore gop cache, jitter=%d", jitter_algorithm); + srs_trace("create consumer, active=%d, ignore gop cache, jitter=%d", hub->active(), jitter_algorithm); } // for edge, when play edge stream, check the state diff --git a/trunk/src/app/srs_app_source.hpp b/trunk/src/app/srs_app_source.hpp index b0696346e..dba9540da 100644 --- a/trunk/src/app/srs_app_source.hpp +++ b/trunk/src/app/srs_app_source.hpp @@ -330,7 +330,6 @@ class SrsOriginHub : public ISrsReloadHandler private: SrsSource* source; SrsRequest* req; - // Whether the stream hub is active, or stream is publishing. bool is_active; private: // The format, codec information. @@ -364,6 +363,8 @@ public: // Cycle the hub, process some regular events, // For example, dispose hls in cycle. virtual srs_error_t cycle(); + // Whether the stream hub is active, or stream is publishing. + virtual bool active(); public: // When got a parsed metadata. virtual srs_error_t on_meta_data(SrsSharedPtrMessage* shared_metadata, SrsOnMetaDataPacket* packet); @@ -376,7 +377,7 @@ public: virtual srs_error_t on_publish(); // When stop publish stream. virtual void on_unpublish(); - // Internal callback. +// Internal callback. public: // For the SrsForwarder to callback to request the sequence headers. virtual srs_error_t on_forwarder_start(SrsForwarder* forwarder); diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index eb575ba5a..6fb3a06b6 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -27,7 +27,7 @@ // The version config. #define VERSION_MAJOR 3 #define VERSION_MINOR 0 -#define VERSION_REVISION 108 +#define VERSION_REVISION 109 // The macros generated by configure script. #include