From 13918ed81f9296a4600f1a87304f7779af4075a0 Mon Sep 17 00:00:00 2001 From: Winlin Date: Wed, 23 Nov 2022 09:50:19 +0800 Subject: [PATCH 1/3] For #3236: Live: Change gop cache limits to 2500. v5.0.94 (#3273) --- trunk/conf/full.conf | 6 +++--- trunk/conf/srs.conf | 2 +- trunk/src/app/srs_app_config.cpp | 2 +- trunk/src/core/srs_core_version5.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index b7ed2bef2..84b9902c5 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -1098,9 +1098,9 @@ vhost play.srs.com { gop_cache off; # Limit the max frames in gop cache. It might cause OOM if video stream has no IDR frame, so we limit to N - # frames by default. - # default: 250 - gop_cache_max_frames 250; + # frames by default. Note that it's the size of gop cache, including videos, audios and other messages. + # default: 2500 + gop_cache_max_frames 2500; # the max live queue length in seconds. # if the messages in the queue exceed the max length, diff --git a/trunk/conf/srs.conf b/trunk/conf/srs.conf index 5194fc262..7ed8d9fea 100644 --- a/trunk/conf/srs.conf +++ b/trunk/conf/srs.conf @@ -38,6 +38,6 @@ vhost __defaultVhost__ { } play{ - gop_cache_max_frames 250; + gop_cache_max_frames 2500; } } diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 22a27c5bf..5d9c6d8d0 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -4663,7 +4663,7 @@ int SrsConfig::get_gop_cache_max_frames(string vhost) { SRS_OVERWRITE_BY_ENV_INT("srs.vhost.play.gop_cache_max_frames"); - static int DEFAULT = 250; + static int DEFAULT = 2500; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index bb5c81146..f5dac0e50 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 93 +#define VERSION_REVISION 94 #endif From f10412d28964141df6c9e39510ac205c6e5b1a2d Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 23 Nov 2022 16:43:52 +0800 Subject: [PATCH 2/3] Asan: Fix utest bug. --- trunk/ide/srs_clion/CMakeLists.txt | 4 +- trunk/src/utest/srs_utest_kernel2.cpp | 92 +++++++++++++-------------- 2 files changed, 49 insertions(+), 47 deletions(-) diff --git a/trunk/ide/srs_clion/CMakeLists.txt b/trunk/ide/srs_clion/CMakeLists.txt index 95ebaabbf..02dd3048a 100755 --- a/trunk/ide/srs_clion/CMakeLists.txt +++ b/trunk/ide/srs_clion/CMakeLists.txt @@ -75,7 +75,7 @@ AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/kernel SOURCE_FILES) AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/protocol SOURCE_FILES) AUX_SOURCE_DIRECTORY(${SRS_DIR}/src/app SOURCE_FILES) -ADD_DEFINITIONS("-g -O0") +ADD_DEFINITIONS("-g -O0 -fsanitize=address -fno-omit-frame-pointer") ########################################################### # Setup SRS project @@ -88,6 +88,7 @@ TARGET_LINK_LIBRARIES(srs dl) TARGET_LINK_LIBRARIES(srs ${DEPS_LIBS}) TARGET_LINK_LIBRARIES(srs -ldl -pthread) TARGET_LINK_LIBRARIES(srs -rdynamic) +TARGET_LINK_LIBRARIES(srs -fsanitize=address -fno-omit-frame-pointer) ########################################################### # For utest. @@ -105,6 +106,7 @@ TARGET_LINK_LIBRARIES(utest gtest gtest_main) TARGET_LINK_LIBRARIES(utest dl) TARGET_LINK_LIBRARIES(utest ${DEPS_LIBS}) TARGET_LINK_LIBRARIES(utest -ldl -pthread) +TARGET_LINK_LIBRARIES(utest -fsanitize=address -fno-omit-frame-pointer) ########################################################### # Done diff --git a/trunk/src/utest/srs_utest_kernel2.cpp b/trunk/src/utest/srs_utest_kernel2.cpp index 22e8416eb..ae59d6423 100644 --- a/trunk/src/utest/srs_utest_kernel2.cpp +++ b/trunk/src/utest/srs_utest_kernel2.cpp @@ -23,24 +23,24 @@ VOID TEST(KernelPSTest, PsPacketDecodeNormal) // PT=DynamicRTP-Type-96, SSRC=0xBEBDFA1, Seq=0, Time=0 if (true) { SrsRtpPacket rtp; + string raw = string( + "\x80\x60\x00\x00\x00\x00\x00\x00\x0b\xeb\xdf\xa1\x00\x00\x01\xba" \ + "\x44\x68\x6e\x4c\x94\x01\x01\x30\x13\xfe\xff\xff\x00\x00\xa0\x05" \ + "\x00\x00\x01\xbb\x00\x12\x80\x98\x09\x04\xe1\x7f\xe0\xe0\x80\xc0" \ + "\xc0\x08\xbd\xe0\x80\xbf\xe0\x80\x00\x00\x01\xbc\x00\x5e\xfc\xff" \ + "\x00\x24\x40\x0e\x48\x4b\x01\x00\x16\x9b\xa5\x22\x2e\xf7\x00\xff" \ + "\xff\xff\x41\x12\x48\x4b\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09" \ + "\x0a\x0b\x0c\x0d\x0e\x0f\x00\x30\x1b\xe0\x00\x1c\x42\x0e\x07\x10" \ + "\x10\xea\x02\x80\x01\xe0\x11\x30\x00\x00\x1c\x20\x2a\x0a\x7f\xff" \ + "\x00\x00\x07\x08\x1f\xfe\x50\x3c\x0f\xc0\x00\x0c\x43\x0a\x00\x90" \ + "\xfe\x02\xb1\x13\x01\xf4\x03\xff\xcb\x85\x54\xb9\x00\x00\x01\xe0" \ + "\x00\x26\x8c\x80\x07\x21\x1a\x1b\x93\x25\xff\xfc\x00\x00\x00\x01" \ + "\x67\x4d\x00\x1e\x9d\xa8\x28\x0f\x69\xb8\x08\x08\x0a\x00\x00\x03" \ + "\x00\x02\x00\x00\x03\x00\x65\x08\x00\x00\x01\xe0\x00\x0e\x8c\x00" \ + "\x03\xff\xff\xfc\x00\x00\x00\x01\x68\xee\x3c\x80\x00\x00\x01\xe0" \ + "\x00\x0e\x8c\x00\x02\xff\xfc\x00\x00\x00\x01\x06\xe5\x01\xba\x80" \ + "\x00\x00\x01\xe0\x35\x62\x8c\x00\x02\xff\xf8\x00\x00\x00\x01\x65", 256) + string(1156, 'x'); if (true) { - string raw = string( - "\x80\x60\x00\x00\x00\x00\x00\x00\x0b\xeb\xdf\xa1\x00\x00\x01\xba" \ - "\x44\x68\x6e\x4c\x94\x01\x01\x30\x13\xfe\xff\xff\x00\x00\xa0\x05" \ - "\x00\x00\x01\xbb\x00\x12\x80\x98\x09\x04\xe1\x7f\xe0\xe0\x80\xc0" \ - "\xc0\x08\xbd\xe0\x80\xbf\xe0\x80\x00\x00\x01\xbc\x00\x5e\xfc\xff" \ - "\x00\x24\x40\x0e\x48\x4b\x01\x00\x16\x9b\xa5\x22\x2e\xf7\x00\xff" \ - "\xff\xff\x41\x12\x48\x4b\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09" \ - "\x0a\x0b\x0c\x0d\x0e\x0f\x00\x30\x1b\xe0\x00\x1c\x42\x0e\x07\x10" \ - "\x10\xea\x02\x80\x01\xe0\x11\x30\x00\x00\x1c\x20\x2a\x0a\x7f\xff" \ - "\x00\x00\x07\x08\x1f\xfe\x50\x3c\x0f\xc0\x00\x0c\x43\x0a\x00\x90" \ - "\xfe\x02\xb1\x13\x01\xf4\x03\xff\xcb\x85\x54\xb9\x00\x00\x01\xe0" \ - "\x00\x26\x8c\x80\x07\x21\x1a\x1b\x93\x25\xff\xfc\x00\x00\x00\x01" \ - "\x67\x4d\x00\x1e\x9d\xa8\x28\x0f\x69\xb8\x08\x08\x0a\x00\x00\x03" \ - "\x00\x02\x00\x00\x03\x00\x65\x08\x00\x00\x01\xe0\x00\x0e\x8c\x00" \ - "\x03\xff\xff\xfc\x00\x00\x00\x01\x68\xee\x3c\x80\x00\x00\x01\xe0" \ - "\x00\x0e\x8c\x00\x02\xff\xfc\x00\x00\x00\x01\x06\xe5\x01\xba\x80" \ - "\x00\x00\x01\xe0\x35\x62\x8c\x00\x02\xff\xf8\x00\x00\x00\x01\x65", 256) + string(1156, 'x'); SrsBuffer b((char*)raw.data(), raw.length()); HELPER_ASSERT_SUCCESS(rtp.decode(&b)); } @@ -64,8 +64,8 @@ VOID TEST(KernelPSTest, PsPacketDecodeNormal) // PT=DynamicRTP-Type-96, SSRC=0xBEBDFA1, Seq=8, Time=0 for (int i = 0; i < 8; i++) { SrsRtpPacket rtp; + string raw = string("\x80\x60\x00\x01\x00\x00\x00\x00\x0b\xeb\xdf\xa1", 12) + string(1400, 'x'); if (true) { - string raw = string("\x80\x60\x00\x01\x00\x00\x00\x00\x0b\xeb\xdf\xa1", 12) + string(1400, 'x'); SrsBuffer b((char*)raw.data(), raw.length()); HELPER_ASSERT_SUCCESS(rtp.decode(&b)); } @@ -81,15 +81,15 @@ VOID TEST(KernelPSTest, PsPacketDecodeNormal) // PT=DynamicRTP-Type-96, SSRC=0xBEBDFA1, Seq=9, Time=0 if (true) { SrsRtpPacket rtp; + string raw = string("\x80\x60\x00\x09\x00\x00\x00\x00\x0b\xeb\xdf\xa1", 12) + string(1300, 'x') + + string("\x00\x00\x01\xbd\x00\x6a\x8c\x80\x07\x21\x1a\x1b\x93\x25\xff\xf8" \ + "\x00\x02\x00\x17\x00\x01\x80\x00\x00\xff\xa0\x05\xe0\xf1\xf0\x50" \ + "\x18\x52\xd6\x5c\xa2\x78\x90\x23\xf9\xf6\x64\xba\xc7\x90\x5e\xd3" \ + "\x80\x2f\x29\xad\x06\xee\x14\x62\xec\x6f\x77\xaa\x71\x80\xb3\x50" \ + "\xb8\xd1\x85\x7f\x44\x30\x4f\x44\xfd\xcd\x21\xe6\x55\x36\x08\x6c" \ + "\xb8\xd1\x85\x7f\x44\x30\x4f\x44\xfd\xcd\x21\xe6\x55\x36\x08\x6c" \ + "\xc9\xf6\x5c\x74", 100); if (true) { - string raw = string("\x80\x60\x00\x09\x00\x00\x00\x00\x0b\xeb\xdf\xa1", 12) + string(1300, 'x') - + string("\x00\x00\x01\xbd\x00\x6a\x8c\x80\x07\x21\x1a\x1b\x93\x25\xff\xf8" \ - "\x00\x02\x00\x17\x00\x01\x80\x00\x00\xff\xa0\x05\xe0\xf1\xf0\x50" \ - "\x18\x52\xd6\x5c\xa2\x78\x90\x23\xf9\xf6\x64\xba\xc7\x90\x5e\xd3" \ - "\x80\x2f\x29\xad\x06\xee\x14\x62\xec\x6f\x77\xaa\x71\x80\xb3\x50" \ - "\xb8\xd1\x85\x7f\x44\x30\x4f\x44\xfd\xcd\x21\xe6\x55\x36\x08\x6c" \ - "\xb8\xd1\x85\x7f\x44\x30\x4f\x44\xfd\xcd\x21\xe6\x55\x36\x08\x6c" \ - "\xc9\xf6\x5c\x74", 100); SrsBuffer b((char*)raw.data(), raw.length()); HELPER_ASSERT_SUCCESS(rtp.decode(&b)); } @@ -105,9 +105,9 @@ VOID TEST(KernelPSTest, PsPacketDecodeNormal) // PT=DynamicRTP-Type-96, SSRC=0xBEBDFA1, Seq=10, Time=0 if (true) { SrsRtpPacket rtp; + string raw("\x80\x60\x00\x0a\x00\x00\x00\x00\x0b\xeb\xdf\xa1" \ + "\x57\xb3\xa3\xbc\x16\x2c\x3c\x9e\x69\x89\x48\xa4", 24); if (true) { - string raw("\x80\x60\x00\x0a\x00\x00\x00\x00\x0b\xeb\xdf\xa1" \ - "\x57\xb3\xa3\xbc\x16\x2c\x3c\x9e\x69\x89\x48\xa4", 24); SrsBuffer b((char*)raw.data(), raw.length()); HELPER_ASSERT_SUCCESS(rtp.decode(&b)); } @@ -123,13 +123,13 @@ VOID TEST(KernelPSTest, PsPacketDecodeNormal) // PT=DynamicRTP-Type-96, SSRC=0xBEBDFA1, Seq=11, Time=3600 if (true) { SrsRtpPacket rtp; + string raw = string("\x80\x60\x00\x0b\x00\x00\x0e\x10\x0b\xeb\xdf\xa1", 12) + + string("\x00\x00\x01\xc0" \ + "\x00\x82\x8c\x80\x09\x21\x1a\x1b\xa3\x51\xff\xff\xff\xf8\xff\xf9" \ + "\x50\x40\x0e\xdf\xfc\x01\x2c\x2e\x84\x28\x23\x0a\x85\x82\xa2\x40" \ + "\x90\x50\x2c\x14\x0b\x05\x42\x41\x30\x90\x44\x28\x16\x08\x84\x82", 52) + + string(84, 'x'); if (true) { - string raw = string("\x80\x60\x00\x0b\x00\x00\x0e\x10\x0b\xeb\xdf\xa1", 12) - + string("\x00\x00\x01\xc0" \ - "\x00\x82\x8c\x80\x09\x21\x1a\x1b\xa3\x51\xff\xff\xff\xf8\xff\xf9" \ - "\x50\x40\x0e\xdf\xfc\x01\x2c\x2e\x84\x28\x23\x0a\x85\x82\xa2\x40" \ - "\x90\x50\x2c\x14\x0b\x05\x42\x41\x30\x90\x44\x28\x16\x08\x84\x82", 52) - + string(84, 'x'); SrsBuffer b((char*)raw.data(), raw.length()); HELPER_ASSERT_SUCCESS(rtp.decode(&b)); } @@ -145,13 +145,13 @@ VOID TEST(KernelPSTest, PsPacketDecodeNormal) // PT=DynamicRTP-Type-96, SSRC=0xBEBDFA1, Seq=12, Time=3600 if (true) { SrsRtpPacket rtp; + string raw = string("\x80\x60\x00\x0c\x00\x00\x0e\x10\x0b\xeb\xdf\xa1", 12) + + string("\x00\x00\x01\xc0" \ + "\x00\x8a\x8c\x80\x09\x21\x1a\x1b\xb3\x7d\xff\xff\xff\xf8\xff\xf9" \ + "\x50\x40\x0f\xdf\xfc\x01\x2c\x2e\x88\x2a\x13\x0a\x09\x82\x41\x10" \ + "\x90\x58\x26\x14\x13\x05\x02\xc2\x10\xa0\x58\x4a\x14\x0a\x85\x02", 52) + + string(92, 'x'); if (true) { - string raw = string("\x80\x60\x00\x0c\x00\x00\x0e\x10\x0b\xeb\xdf\xa1", 12) - + string("\x00\x00\x01\xc0" \ - "\x00\x8a\x8c\x80\x09\x21\x1a\x1b\xb3\x7d\xff\xff\xff\xf8\xff\xf9" \ - "\x50\x40\x0f\xdf\xfc\x01\x2c\x2e\x88\x2a\x13\x0a\x09\x82\x41\x10" \ - "\x90\x58\x26\x14\x13\x05\x02\xc2\x10\xa0\x58\x4a\x14\x0a\x85\x02", 52) - + string(92, 'x'); SrsBuffer b((char*)raw.data(), raw.length()); HELPER_ASSERT_SUCCESS(rtp.decode(&b)); } @@ -167,13 +167,13 @@ VOID TEST(KernelPSTest, PsPacketDecodeNormal) // PT=DynamicRTP-Type-96, SSRC=0xBEBDFA1, Seq=13, Time=3600 if (true) { SrsRtpPacket rtp; + string raw = string("\x80\x60\x00\x0d\x00\x00\x0e\x10\x0b\xeb\xdf\xa1", 12) + + string("\x00\x00\x01\xba" \ + "\x44\x68\x6e\xbd\x14\x01\x01\x30\x13\xfe\xff\xff\x00\x00\xa0\x06" \ + "\x00\x00\x01\xe0\x03\x4a\x8c\x80\x08\x21\x1a\x1b\xaf\x45\xff\xff" \ + "\xf8\x00\x00\x00\x01\x61\xe0\x08\xbf\x3c\xb6\x63\x68\x4b\x7f\xea", 52) + + string(816, 'x'); if (true) { - string raw = string("\x80\x60\x00\x0d\x00\x00\x0e\x10\x0b\xeb\xdf\xa1", 12) - + string("\x00\x00\x01\xba" \ - "\x44\x68\x6e\xbd\x14\x01\x01\x30\x13\xfe\xff\xff\x00\x00\xa0\x06" \ - "\x00\x00\x01\xe0\x03\x4a\x8c\x80\x08\x21\x1a\x1b\xaf\x45\xff\xff" \ - "\xf8\x00\x00\x00\x01\x61\xe0\x08\xbf\x3c\xb6\x63\x68\x4b\x7f\xea", 52) - + string(816, 'x'); SrsBuffer b((char*)raw.data(), raw.length()); HELPER_ASSERT_SUCCESS(rtp.decode(&b)); } From 237d60a55da8e20fb63f4ca8b2244597b3a4ee87 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 23 Nov 2022 18:30:47 +0800 Subject: [PATCH 3/3] Coverage: Refine the codecov link. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d3c24417b..cdb00a48b 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![](https://github.com/ossrs/srs/actions/workflows/codeql-analysis.yml/badge.svg?branch=5.0release)](https://github.com/ossrs/srs/actions?query=workflow%3ACodeQL+branch%3A5.0release) [![](https://github.com/ossrs/srs/actions/workflows/release.yml/badge.svg)](https://github.com/ossrs/srs/actions/workflows/release.yml?query=workflow%3ARelease) [![](https://github.com/ossrs/srs/actions/workflows/test.yml/badge.svg?branch=5.0release)](https://github.com/ossrs/srs/actions?query=workflow%3ATest+branch%3A5.0release) -[![](https://codecov.io/gh/ossrs/srs/branch/5.0release/graph/badge.svg)](https://codecov.io/gh/ossrs/srs/branch/5.0release) +[![](https://codecov.io/gh/ossrs/srs/branch/5.0release/graph/badge.svg?token=Zx2LhdtA39)](https://app.codecov.io/gh/ossrs/srs/tree/5.0release) [![](https://ossrs.net/wiki/images/wechat-badge4.svg)](https://ossrs.net/lts/zh-cn/contact#discussion) [![](https://img.shields.io/twitter/follow/srs_server?style=social)](https://twitter.com/srs_server) [![](https://badgen.net/discord/members/yZ4BnPmHAd)](https://discord.gg/yZ4BnPmHAd)