mirror of
https://github.com/ossrs/srs.git
synced 2025-02-12 11:21:52 +00:00
Bugfix: Fix rtcp nack blp encode bug (#2966). v4.0.248
Co-authored-by: Winlin <winlin@vip.126.com>
This commit is contained in:
parent
e26db694ca
commit
ab81696102
4 changed files with 37 additions and 3 deletions
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
|||
|
||||
## SRS 4.0 Changelog
|
||||
|
||||
* v4.0, 2022-03-15, Merge [#2966](https://github.com/ossrs/srs/pull/2966): Bugfix: Fix rtcp nack blp encode bug (#2966). v4.0.248
|
||||
* v4.0, 2022-03-07, RTC: Identify the WebRTC publisher in param for hooks. v4.0.247
|
||||
* v4.0, 2022-03-07, SRT: Append vhost to stream, not app. v4.0.246
|
||||
* v4.0, 2022-02-15, Fix warnings for uuid. v4.0.245
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
|
||||
#define VERSION_MAJOR 4
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 247
|
||||
#define VERSION_REVISION 248
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1346,9 +1346,11 @@ srs_error_t SrsRtcpNack::encode(SrsBuffer *buffer)
|
|||
if((sn - pid) < 1) {
|
||||
srs_info("skip seq %d", sn);
|
||||
} else if( (sn - pid) > 16) {
|
||||
// add new chunk
|
||||
// append full chunk
|
||||
chunks.push_back(chunk);
|
||||
chunk.pid = sn;
|
||||
|
||||
// start new chunk
|
||||
chunk.pid = sn;
|
||||
chunk.blp = 0;
|
||||
chunk.in_use = true;
|
||||
pid = sn;
|
||||
|
|
|
@ -1169,6 +1169,36 @@ VOID TEST(KernelRTCTest, SyncTimestampBySenderReportConsecutive)
|
|||
}
|
||||
}
|
||||
|
||||
VOID TEST(KernelRTCTest, SrsRtcpNack)
|
||||
{
|
||||
uint32_t sender_ssrc = 0x0A;
|
||||
uint32_t media_ssrc = 0x0B;
|
||||
|
||||
SrsRtcpNack nack_encoder(sender_ssrc);
|
||||
nack_encoder.set_media_ssrc(media_ssrc);
|
||||
|
||||
for (uint16_t seq = 15; seq < 45; seq++) {
|
||||
nack_encoder.add_lost_sn(seq);
|
||||
}
|
||||
EXPECT_FALSE(nack_encoder.empty());
|
||||
|
||||
char buf[kRtcpPacketSize];
|
||||
SrsBuffer stream(buf, sizeof(buf));
|
||||
|
||||
srs_error_t err = srs_success;
|
||||
err = nack_encoder.encode(&stream);
|
||||
EXPECT_EQ(srs_error_code(err), srs_success);
|
||||
|
||||
SrsRtcpNack nack_decoder;
|
||||
stream.skip(-stream.pos());
|
||||
err = nack_decoder.decode(&stream);
|
||||
EXPECT_EQ(srs_error_code(err), srs_success);
|
||||
|
||||
vector<uint16_t> actual_lost_sn = nack_encoder.get_lost_sns();
|
||||
vector<uint16_t> req_lost_sns = nack_decoder.get_lost_sns();
|
||||
EXPECT_EQ(actual_lost_sn.size(), req_lost_sns.size());
|
||||
}
|
||||
|
||||
VOID TEST(KernelRTCTest, SyncTimestampBySenderReportDuplicated)
|
||||
{
|
||||
SrsRtcConnection s(NULL, SrsContextId());
|
||||
|
@ -1243,3 +1273,4 @@ VOID TEST(KernelRTCTest, SyncTimestampBySenderReportDuplicated)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue