Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libwebrtc fixes and updates #944

Merged
merged 3 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* `DataConsumer`: Fix `bufferedAmount` type to be a number again (PR #936).
* `ActiveSpeakerObserver`: Fix 'dominantspeaker' event by having a single `Producer` as argument rather than an array with a single `Producer` into it (PR #941).
* `ActiveSpeakerObserver`: Fix memory leak (PR #942).
* Fix some libwebrtc issues (PR #944).
* Update NPM deps.


Expand All @@ -19,7 +20,7 @@

### 3.10.11

* RTCP: Fix trailing space needed by srtp_protect_rtcp() (PR #929).
* RTCP: Fix trailing space needed by `srtp_protect_rtcp()` (PR #929).


### 3.10.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,26 +382,29 @@ void SendSideBandwidthEstimation::UpdatePacketsLost(int packets_lost,

// Check sequence number diff and weight loss report
if (number_of_packets > 0) {
// Accumulate reports.
lost_packets_since_last_loss_update_ += packets_lost;
expected_packets_since_last_loss_update_ += number_of_packets;
int64_t expected =
expected_packets_since_last_loss_update_ + number_of_packets;

// Don't generate a loss rate until it can be based on enough packets.
if (expected_packets_since_last_loss_update_ < kLimitNumPackets)
if (expected < kLimitNumPackets) {
// Accumulate reports.
expected_packets_since_last_loss_update_ = expected;
lost_packets_since_last_loss_update_ += packets_lost;
return;
}

has_decreased_since_last_fraction_loss_ = false;
int64_t lost_q8 = lost_packets_since_last_loss_update_ << 8;
int64_t expected = expected_packets_since_last_loss_update_;
int64_t lost_q8 =
std::max<int64_t>(lost_packets_since_last_loss_update_ + packets_lost, 0) << 8;
last_fraction_loss_ = std::min<int>(lost_q8 / expected, 255);

// Reset accumulators.

lost_packets_since_last_loss_update_ = 0;
expected_packets_since_last_loss_update_ = 0;
last_loss_packet_report_ = at_time;
UpdateEstimate(at_time);
}

UpdateUmaStatsPacketsLost(at_time, packets_lost);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback(
for (const auto& feedback : feedbacks) {
TimeDelta feedback_rtt =
report.feedback_time - feedback.sent_packet.send_time;
TimeDelta min_pending_time = feedback.receive_time - max_recv_time;
TimeDelta min_pending_time = max_recv_time - feedback.receive_time;
TimeDelta propagation_rtt = feedback_rtt - min_pending_time;
max_feedback_rtt = std::max(max_feedback_rtt, feedback_rtt);
min_propagation_rtt = std::min(min_propagation_rtt, propagation_rtt);
Expand Down