Change NetEq::GetPlayoutTimestamp to return an rtc::Optional<uint32_t>
This is in preparation for changes to when the playout timestamp is
valid.
BUG=webrtc:5669
Review URL: https://codereview.webrtc.org/1853183002
Cr-Commit-Position: refs/heads/master@{#12256}
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index aa97381..b4dfc99 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -401,15 +401,15 @@
vad_->Disable();
}
-bool NetEqImpl::GetPlayoutTimestamp(uint32_t* timestamp) {
+rtc::Optional<uint32_t> NetEqImpl::GetPlayoutTimestamp() {
rtc::CritScope lock(&crit_sect_);
if (first_packet_) {
// We don't have a valid RTP timestamp until we have decoded our first
// RTP packet.
- return false;
+ return rtc::Optional<uint32_t>();
}
- *timestamp = timestamp_scaler_->ToExternal(playout_timestamp_);
- return true;
+ return rtc::Optional<uint32_t>(
+ timestamp_scaler_->ToExternal(playout_timestamp_));
}
int NetEqImpl::last_output_sample_rate_hz() const {