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}
This commit is contained in:
Rasmus Brandt
2018-06-26 12:34:59 +02:00
committed by Commit Bot
parent b1f48bcfd3
commit 7b92ceb0ee

View File

@ -269,6 +269,9 @@ void VideoProcessor::ProcessFrame() {
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;