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}
This commit is contained in:
henrik.lundin
2016-04-06 01:39:22 -07:00
committed by Commit bot
parent 05255b0e8a
commit 9a410dd082
13 changed files with 77 additions and 58 deletions

View File

@ -401,15 +401,15 @@ void NetEqImpl::DisableVad() {
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 {