Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: webrtc/modules/audio_coding/test/delay_test.cc

Issue 1853183002: Change NetEq::GetPlayoutTimestamp to return an rtc::Optional<uint32_t> (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/test/delay_test.cc
diff --git a/webrtc/modules/audio_coding/test/delay_test.cc b/webrtc/modules/audio_coding/test/delay_test.cc
index 7288d5040a45ba22da0d1eeb4de993e9815cbc9c..03de7556c70c736b64b5c011d2494c5003499c0e 100644
--- a/webrtc/modules/audio_coding/test/delay_test.cc
+++ b/webrtc/modules/audio_coding/test/delay_test.cc
@@ -180,7 +180,6 @@ class DelayTest {
int num_frames = 0;
int in_file_frames = 0;
- uint32_t playout_ts;
uint32_t received_ts;
double average_delay = 0;
double inst_delay_sec = 0;
@@ -209,10 +208,10 @@ class DelayTest {
out_file_b_.Write10MsData(
audio_frame.data_,
audio_frame.samples_per_channel_ * audio_frame.num_channels_);
- acm_b_->PlayoutTimestamp(&playout_ts);
received_ts = channel_a2b_->LastInTimestamp();
- inst_delay_sec = static_cast<uint32_t>(received_ts - playout_ts)
- / static_cast<double>(encoding_sample_rate_hz_);
+ inst_delay_sec =
+ static_cast<uint32_t>(received_ts - *acm_b_->PlayoutTimestamp()) /
+ static_cast<double>(encoding_sample_rate_hz_);
if (num_frames > 10)
average_delay = 0.95 * average_delay + 0.05 * inst_delay_sec;

Powered by Google App Engine
This is Rietveld 408576698