Relax conditions in the PictureIdTest that checks if streams have recreated.

Bug: webrtc:13725
Change-Id: I2bdb5b8f09ec2b0262db661d29febc34ebaaf78b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269680
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37643}
This commit is contained in:
Byoungchan Lee
2022-07-28 23:35:34 +09:00
committed by WebRTC LUCI CQ
parent 3f21ba68bc
commit a1aedc0c00

View File

@ -135,11 +135,15 @@ class PictureIdObserver : public test::RtpRtcpObserver {
// Expect continuously increasing picture id.
int diff = ForwardDiff<uint16_t, kPictureIdWraparound>(last.picture_id,
current.picture_id);
if (diff > 1) {
EXPECT_LE(diff - 1, max_expected_picture_id_gap_);
if (diff > 2) {
// If the VideoSendStream is destroyed, any frames still in queue is lost.
// Gaps only possible for first frame after a recreation, i.e. key frames.
// This can result in a two-frame gap, which will result in logs like
// "packet transmission failed, no matching RTP module found, or
// transmission error".
// A larger gap is only possible for first frame after a recreation, i.e.
// key frames.
EXPECT_EQ(VideoFrameType::kVideoFrameKey, current.frame_type);
EXPECT_LE(diff - 1, max_expected_picture_id_gap_);
}
}