Skip to content

Commit

Permalink
Fix nack handling bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sile committed May 29, 2024
1 parent 3b826f8 commit bcc1b18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/rtcpnackresponder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ optional<binary_ptr> RtcpNackResponder::Storage::get(uint16_t sequenceNumber) {
: nullopt;
}

void RtcpNackResponder::Storage::store(binary_ptr packet) {
if (!packet || packet->size() < sizeof(RtpHeader))
void RtcpNackResponder::Storage::store(binary_ptr message) {
if (!message || message->size() < sizeof(RtpHeader))
return;

// We need to create a deep copy of the message binary here because the content
// of the binary will be modified by the srtp_protect() function when the message is sent.
auto packet = std::make_shared<binary>(message->begin(), message->end());

auto rtp = reinterpret_cast<RtpHeader *>(packet->data());
auto sequenceNumber = rtp->seqNumber();

Expand Down

0 comments on commit bcc1b18

Please sign in to comment.