diff --git a/video/receive_statistics_proxy.cc b/video/receive_statistics_proxy.cc index 4f3b6b9db8..42ab7e19ec 100644 --- a/video/receive_statistics_proxy.cc +++ b/video/receive_statistics_proxy.cc @@ -692,6 +692,7 @@ void ReceiveStatisticsProxy::OnDecodedFrame(const VideoFrame& frame, } else if (stats_.qp_sum) { RTC_LOG(LS_WARNING) << "QP sum was already set and no QP was given for a frame."; + stats_.qp_sum.reset(); } decode_time_counter_.Add(decode_time_ms); stats_.decode_ms = decode_time_ms; diff --git a/video/receive_statistics_proxy_unittest.cc b/video/receive_statistics_proxy_unittest.cc index e5727894f6..fffc42ce0d 100644 --- a/video/receive_statistics_proxy_unittest.cc +++ b/video/receive_statistics_proxy_unittest.cc @@ -352,7 +352,7 @@ TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpQpSumWontExist) { EXPECT_EQ(absl::nullopt, statistics_proxy_->GetStats().qp_sum); } -TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpDoesNotResetQpSum) { +TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpResetsQpSum) { webrtc::VideoFrame frame = CreateFrame(kWidth, kHeight); EXPECT_EQ(absl::nullopt, statistics_proxy_->GetStats().qp_sum); statistics_proxy_->OnDecodedFrame(frame, 3u, 0, @@ -360,7 +360,7 @@ TEST_F(ReceiveStatisticsProxyTest, OnDecodedFrameWithoutQpDoesNotResetQpSum) { EXPECT_EQ(3u, statistics_proxy_->GetStats().qp_sum); statistics_proxy_->OnDecodedFrame(frame, absl::nullopt, 0, VideoContentType::UNSPECIFIED); - EXPECT_EQ(3u, statistics_proxy_->GetStats().qp_sum); + EXPECT_EQ(absl::nullopt, statistics_proxy_->GetStats().qp_sum); } TEST_F(ReceiveStatisticsProxyTest, OnRenderedFrameIncreasesFramesRendered) {