diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index c7f13839e..ad9b10a40 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -7,6 +7,7 @@ The changelog for SRS. ## SRS 5.0 Changelog +* v5.0, 2024-10-15, Merge [#4160](https://github.com/ossrs/srs/pull/4160): RTC2RTMP: Fix screen sharing stutter caused by packet loss. v5.0.216 (#4160) * v5.0, 2024-09-09, Merge [#4171](https://github.com/ossrs/srs/pull/4171): Heartbeat: Report ports for proxy server. v5.0.215 (#4171) * v5.0, 2024-07-24, Merge [#4126](https://github.com/ossrs/srs/pull/4126): Edge: Improve stability for state and fd closing. v5.0.214 (#4126) * v5.0, 2024-06-03, Merge [#4057](https://github.com/ossrs/srs/pull/4057): RTC: Support dropping h.264 SEI from NALUs. v5.0.213 (#4057) diff --git a/trunk/src/app/srs_app_rtc_source.cpp b/trunk/src/app/srs_app_rtc_source.cpp index 8b1102d6a..4cd8fa62a 100644 --- a/trunk/src/app/srs_app_rtc_source.cpp +++ b/trunk/src/app/srs_app_rtc_source.cpp @@ -1705,6 +1705,23 @@ srs_error_t SrsRtmpFromRtcBridge::packet_video_rtmp(const uint16_t start, const if (0 == nb_payload) { srs_warn("empty nalu"); + + // The chrome web browser send RTP packet with empty payload frequently, + // reset header_sn_, lost_sn_ and continue to found next frame in this case, + // otherwise, all the cached RTP packets are dropped before next key frame arrive. + header_sn_ = end + 1; + uint16_t tail_sn = 0; + int sn = find_next_lost_sn(header_sn_, tail_sn); + if (-1 == sn) { + if (check_frame_complete(header_sn_, tail_sn)) { + err = packet_video_rtmp(header_sn_, tail_sn); + } + } else if (-2 == sn) { + return srs_error_new(ERROR_RTC_RTP_MUXER, "video cache is overflow"); + } else { + lost_sn_ = sn; + } + return err; } diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index b0005c0b4..19ba76ca5 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 215 +#define VERSION_REVISION 216 #endif