Index: webrtc/modules/remote_bitrate_estimator/inter_arrival.cc |
diff --git a/webrtc/modules/remote_bitrate_estimator/inter_arrival.cc b/webrtc/modules/remote_bitrate_estimator/inter_arrival.cc |
index a9a7ae7d07fb286d653b78346863b58c803b655b..3dee305bad109170c11650b81afd2bb7368581bb 100644 |
--- a/webrtc/modules/remote_bitrate_estimator/inter_arrival.cc |
+++ b/webrtc/modules/remote_bitrate_estimator/inter_arrival.cc |
@@ -13,6 +13,7 @@ |
#include <algorithm> |
#include <cassert> |
+#include "webrtc/base/logging.h" |
#include "webrtc/modules/interface/module_common_types.h" |
namespace webrtc { |
@@ -52,6 +53,14 @@ bool InterArrival::ComputeDeltas(uint32_t timestamp, |
prev_timestamp_group_.timestamp; |
*arrival_time_delta_ms = current_timestamp_group_.complete_time_ms - |
prev_timestamp_group_.complete_time_ms; |
+ if (*arrival_time_delta_ms < 0) { |
+ // The group of packets has been reordered since receiving its local |
+ // arrival timestamp. |
+ LOG(LS_WARNING) << "Packets are being reordered on the path from the " |
+ "socket to the bandwidth estimator. Ignoring this " |
+ "packet for bandwidth estimation."; |
+ return false; |
+ } |
assert(*arrival_time_delta_ms >= 0); |
pbos-webrtc
2015/07/24 09:04:37
Do you need this assert now? :D
|
*packet_size_delta = static_cast<int>(current_timestamp_group_.size) - |
static_cast<int>(prev_timestamp_group_.size); |