Tolerate out of order samples to SendProcessingUsage2::FrameSent.
Bug: chromium:842613 Change-Id: I57e4df75dcfdfb9bf42819f31d2186e875a90a3a Reviewed-on: https://webrtc-review.googlesource.com/92880 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24224}
This commit is contained in:
@ -249,6 +249,14 @@ class SendProcessingUsage2 : public OveruseFrameDetector::ProcessingUsage {
|
||||
absl::optional<int> encode_duration_us) override {
|
||||
if (encode_duration_us) {
|
||||
if (prev_time_us_ != -1) {
|
||||
if (capture_time_us < prev_time_us_) {
|
||||
// The weighting in AddSample assumes that samples are processed with
|
||||
// non-decreasing measurement timestamps. We could implement
|
||||
// appropriate weights for samples arriving late, but since it is a
|
||||
// rare case, keep things simple, by just pushing those measurements a
|
||||
// bit forward in time.
|
||||
capture_time_us = prev_time_us_;
|
||||
}
|
||||
AddSample(1e-6 * (*encode_duration_us),
|
||||
1e-6 * (capture_time_us - prev_time_us_));
|
||||
}
|
||||
|
Reference in New Issue
Block a user