diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc index 4e1913dc35..1eb55afa24 100644 --- a/webrtc/voice_engine/channel.cc +++ b/webrtc/voice_engine/channel.cc @@ -906,6 +906,7 @@ Channel::Channel(int32_t channelId, _decryptionRTCPBufferPtr(NULL), _timeStamp(0), // This is just an offset, RTP module will add it's own random offset _sendTelephoneEventPayloadType(106), + jitter_buffer_playout_timestamp_(0), playout_timestamp_rtp_(0), playout_timestamp_rtcp_(0), _numberOfDiscardedPackets(0), @@ -4718,6 +4719,8 @@ void Channel::UpdatePlayoutTimestamp(bool rtcp) { } } + jitter_buffer_playout_timestamp_ = playout_timestamp; + // Remove the playout delay. playout_timestamp -= (delay_ms * (playout_frequency / 1000)); @@ -5071,10 +5074,10 @@ void Channel::UpdatePacketDelay(uint32_t rtp_timestamp, rtp_receive_frequency = 48000; } - // playout_timestamp_rtp_ updated in UpdatePlayoutTimestamp for every incoming - // packet. - uint32_t timestamp_diff_ms = (rtp_timestamp - playout_timestamp_rtp_) / - (rtp_receive_frequency / 1000); + // |jitter_buffer_playout_timestamp_| updated in UpdatePlayoutTimestamp for + // every incoming packet. + uint32_t timestamp_diff_ms = (rtp_timestamp - + jitter_buffer_playout_timestamp_) / (rtp_receive_frequency / 1000); uint16_t packet_delay_ms = (rtp_timestamp - _previousTimestamp) / (rtp_receive_frequency / 1000); diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h index da55e9d765..f8b04fdd18 100644 --- a/webrtc/voice_engine/channel.h +++ b/webrtc/voice_engine/channel.h @@ -489,6 +489,9 @@ private: uint8_t* _decryptionRTCPBufferPtr; uint32_t _timeStamp; uint8_t _sendTelephoneEventPayloadType; + + // Timestamp of the audio pulled from NetEq. + uint32_t jitter_buffer_playout_timestamp_; uint32_t playout_timestamp_rtp_; uint32_t playout_timestamp_rtcp_; uint32_t playout_delay_ms_;