awslabs / amazon-kinesis-video-streams-webrtc-sdk-c

Amazon Kinesis Video Streams Webrtc SDK is for developers to install and customize realtime communication between devices and enable secure streaming of video, audio to Kinesis Video Streams.
https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-c/group__PublicMemberFunctions.html
Apache License 2.0
993 stars 297 forks source link

[Bug]: KVS SDK RTP retransmitter bug #1991

Open wei-zhang-simplisafe opened 1 month ago

wei-zhang-simplisafe commented 1 month ago

Please confirm you have already done the following

Please answer the following prompt

Describe the bug

There is a bug at https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/blob/master/src/source/PeerConnection/Retransmitter.c#L108

sequenceNumberList should be replaced by validIndexList

For RTC sequence number <= 65536, sequenceNumberList and validIndexList have the same value, the code still works. At 2Mbps, after 300 seconds of livestreaming, KVS SDK will fail to put retransmited packets back into rolling buffer and the video quality could suffer.

Expected Behavior

Re-transmitter always works

Current Behavior

Re-transmitter fails after sending 65536 RTP packets

Reproduction Steps

after sending 65536 RTP packets, re-transmit will fail with STATUS_ROLLING_BUFFER_NOT_IN_RANGE

WebRTC C SDK version being used

latest as of 05/20/2024

If it was working in a previous version, which one?

No response

Compiler and Version used

all compilers

Operating System and version

all OS

Platform being used

all platform

wei-zhang-simplisafe commented 1 month ago

This ticket is exactly the same as https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-c/issues/1453 The previous ticket was submitted two years ago. I am surprised that it was never fixed

hassanctech commented 1 month ago

@wei-zhang-simplisafe I'm working on validating the finding, when I have an update I will post it here.