Fix tiny race condition when Vp9NonFlexMode_* tests were failing.
TSAN complained at each failure, which only added confusion. Bug: webrtc:11243 Change-Id: Ic36ec13562699478be23050a7b723e1b9bb47f0e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164528 Reviewed-by: Henrik Andreassson <henrika@webrtc.org> Commit-Queue: Yves Gerey <yvesg@google.com> Cr-Commit-Position: refs/heads/master@{#30161}
This commit is contained in:
@ -3149,8 +3149,13 @@ class Vp9HeaderObserver : public test::SendTest {
|
||||
}
|
||||
|
||||
void PerformTest() override {
|
||||
EXPECT_TRUE(Wait()) << "Test timed out waiting for VP9 packet, num frames "
|
||||
bool wait = Wait();
|
||||
{
|
||||
// In case of time out, OnSendRtp might still access frames_sent_;
|
||||
rtc::CritScope lock(&crit_);
|
||||
EXPECT_TRUE(wait) << "Test timed out waiting for VP9 packet, num frames "
|
||||
<< frames_sent_;
|
||||
}
|
||||
}
|
||||
|
||||
Action OnSendRtp(const uint8_t* packet, size_t length) override {
|
||||
@ -3179,6 +3184,7 @@ class Vp9HeaderObserver : public test::SendTest {
|
||||
|
||||
++packets_sent_;
|
||||
if (rtp_packet.Marker()) {
|
||||
rtc::CritScope lock(&crit_);
|
||||
++frames_sent_;
|
||||
}
|
||||
last_packet_marker_ = rtp_packet.Marker();
|
||||
@ -3405,6 +3411,7 @@ class Vp9HeaderObserver : public test::SendTest {
|
||||
uint32_t last_packet_timestamp_ = 0;
|
||||
RTPVideoHeaderVP9 last_vp9_;
|
||||
size_t packets_sent_;
|
||||
rtc::CriticalSection crit_;
|
||||
size_t frames_sent_;
|
||||
int expected_width_;
|
||||
int expected_height_;
|
||||
|
Reference in New Issue
Block a user