Ensure that input_frames_.size() <= kMaxBufferedInputFrames at enqueue time.
Bug: webrtc:9452
Change-Id: I6d415a2cb24461d7359ff30e6499d65d88d2b2f8
Reviewed-on: https://webrtc-review.googlesource.com/85371
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23846}diff --git a/modules/video_coding/codecs/test/videoprocessor.cc b/modules/video_coding/codecs/test/videoprocessor.cc
index 0cf2fa0..24a0f01 100644
--- a/modules/video_coding/codecs/test/videoprocessor.cc
+++ b/modules/video_coding/codecs/test/videoprocessor.cc
@@ -269,6 +269,9 @@
webrtc::kVideoRotation_0);
// Store input frame as a reference for quality calculations.
if (config_.decode && !config_.measure_cpu) {
+ if (input_frames_.size() == kMaxBufferedInputFrames) {
+ input_frames_.erase(input_frames_.begin());
+ }
input_frames_.emplace(frame_number, input_frame);
}
last_inputed_timestamp_ = timestamp;