Fix jitter buffer delay estimate.

BUG=b/12099925
R=niklas.enbom@webrtc.org, niklase@google.com, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/5739004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5289 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turaj@webrtc.org 2013-12-13 21:05:07 +00:00
parent 24301a67c6
commit 167b6dfc73
2 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -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_;