From 1a37aa197edbebcc43ac83b4b88d58787b05b3b2 Mon Sep 17 00:00:00 2001 From: Jeremy Leconte Date: Tue, 19 Mar 2024 17:42:46 +0100 Subject: [PATCH] Fix frame not found error when encoder is paused. The problem occurs when a frame is sent again because the encoder was paused but the frame has already been received by all participants: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/video_stream_encoder.cc;l=2322 Change-Id: If8890986301c44a472db9bc4750d23761c150669 Bug: b/328175783 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/343560 Reviewed-by: Artem Titov Commit-Queue: Jeremy Leconte Cr-Commit-Position: refs/heads/main@{#41931} --- .../e2e/analyzer/video/default_video_quality_analyzer.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc b/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc index 473461c3ba..d2f5725cc9 100644 --- a/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc +++ b/test/pc/e2e/analyzer/video/default_video_quality_analyzer.cc @@ -285,8 +285,12 @@ void DefaultVideoQualityAnalyzer::OnFramePreEncode( << "DefaultVideoQualityAnalyzer has to be started before use"; auto it = captured_frames_in_flight_.find(frame.id()); - RTC_CHECK(it != captured_frames_in_flight_.end()) - << "Frame id=" << frame.id() << " not found"; + if (it == captured_frames_in_flight_.end()) { + // If the frame is not found, it is possible that it has been encoded twice + // and that it was received by all the participants the first time. + RTC_LOG(LS_WARNING) << "Frame id=" << frame.id() << " not found."; + return; + } FrameInFlight& frame_in_flight = it->second; frame_counters_.pre_encoded++; size_t peer_index = peers_->index(peer_name);