Fix a bug where packets retransmitted for NACK are encrypted with SRTP twice #1198
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Let me report a NACK handling bug and submit a PR to fix it.
I used OBS Studio (30.1.2) WHIP to publish a video stream to a WebRTC SFU server.
When the network became unstable and NACK packets were sent from the server, the video stream appeared corrupted on the viewer’s side.
After some debugging, it was discovered that the packet binaries stored in
RtcpNackResponder
were unintentionally modified by thesrtp_protect()
function when the messages were first sent. As a result, when the packets were re-sent to the server for NACK, they were encrypted twice.This PR fixes the issue by deep copying messages before they are stored in
RtcpNackResponder
.