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

Unified Diff: webrtc/voice_engine/channel.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: Adding back the old PlayoutTimestamp method, now DEPRECATED 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/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 4dd231b723c8794bc1d739ab0c05eee2d2b3196a..c91d0d6dc8814abf380b01db075495fe19020a28 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -3288,9 +3288,9 @@ int32_t Channel::MixAudioWithFile(AudioFrame& audioFrame, int mixingFrequency) {
}
void Channel::UpdatePlayoutTimestamp(bool rtcp) {
- uint32_t playout_timestamp = 0;
+ rtc::Optional<uint32_t> playout_timestamp = audio_coding_->PlayoutTimestamp();
- if (audio_coding_->PlayoutTimestamp(&playout_timestamp) == -1) {
+ if (!playout_timestamp) {
// This can happen if this channel has not been received any RTP packet. In
// this case, NetEq is not capable of computing playout timestamp.
return;
@@ -3307,21 +3307,21 @@ void Channel::UpdatePlayoutTimestamp(bool rtcp) {
return;
}
- jitter_buffer_playout_timestamp_ = playout_timestamp;
+ jitter_buffer_playout_timestamp_ = *playout_timestamp;
// Remove the playout delay.
- playout_timestamp -= (delay_ms * (GetPlayoutFrequency() / 1000));
+ *playout_timestamp -= (delay_ms * (GetPlayoutFrequency() / 1000));
WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::UpdatePlayoutTimestamp() => playoutTimestamp = %lu",
- playout_timestamp);
+ *playout_timestamp);
{
rtc::CritScope lock(&video_sync_lock_);
if (rtcp) {
- playout_timestamp_rtcp_ = playout_timestamp;
+ playout_timestamp_rtcp_ = *playout_timestamp;
} else {
- playout_timestamp_rtp_ = playout_timestamp;
+ playout_timestamp_rtp_ = *playout_timestamp;
}
playout_delay_ms_ = delay_ms;
}

Powered by Google App Engine
This is Rietveld 408576698