From 31229cee609b8b1357862788a0b6ede3be2e5542 Mon Sep 17 00:00:00 2001 From: Eugene Voityuk Date: Tue, 6 Sep 2022 21:29:17 +0300 Subject: [PATCH] Fix tests. Adopt changes to GetBaseDelta from https://github.com/versatica/mediasoup/pull/900 Add tests for GetBaseDelta Wraparound. --- .../remote_bitrate_estimator/inter_arrival.cc | 12 ++---------- .../modules/remote_bitrate_estimator/inter_arrival.h | 6 +----- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/inter_arrival.cc b/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/inter_arrival.cc index 46e2df75dc..daa9c861d2 100644 --- a/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/inter_arrival.cc +++ b/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/inter_arrival.cc @@ -48,7 +48,7 @@ bool InterArrival::ComputeDeltas(uint32_t timestamp, current_timestamp_group_.timestamp = timestamp; current_timestamp_group_.first_timestamp = timestamp; current_timestamp_group_.first_arrival_ms = arrival_time_ms; - } else if (!PacketInOrder(timestamp, arrival_time_ms)) { + } else if (!PacketInOrder(timestamp)) { return false; } else if (NewTimestampGroup(arrival_time_ms, timestamp)) { // First packet of a later frame, the previous frame sample is ready. @@ -115,17 +115,9 @@ bool InterArrival::ComputeDeltas(uint32_t timestamp, return calculated_deltas; } -bool InterArrival::PacketInOrder(uint32_t timestamp, int64_t arrival_time_ms) { +bool InterArrival::PacketInOrder(uint32_t timestamp) { if (current_timestamp_group_.IsFirstPacket()) { return true; - } else if (arrival_time_ms < 0) { - // NOTE: Change related to https://github.com/versatica/mediasoup/issues/357 - // - // Sometimes we do get negative arrival time, which causes BelongsToBurst() - // to fail, which may cause anything that uses InterArrival to crash. - // - // Credits to @sspanak and @Ivaka. - return false; } else { // Assume that a diff which is bigger than half the timestamp interval // (32 bits) must be due to reordering. This code is almost identical to diff --git a/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/inter_arrival.h b/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/inter_arrival.h index 1602a62bb7..8ce1c145d1 100644 --- a/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/inter_arrival.h +++ b/worker/deps/libwebrtc/libwebrtc/modules/remote_bitrate_estimator/inter_arrival.h @@ -71,11 +71,7 @@ class InterArrival { }; // Returns true if the packet with timestamp |timestamp| arrived in order. - // - // NOTE: Change related to https://github.com/versatica/mediasoup/issues/357 - // - // bool PacketInOrder(uint32_t timestamp); - bool PacketInOrder(uint32_t timestamp, int64_t arrival_time_ms); + bool PacketInOrder(uint32_t timestamp); // Returns true if the last packet was the end of the current batch and the // packet with |timestamp| is the first of a new batch.