Chromium Code Reviews| Index: webrtc/voice_engine/channel.cc | 
| diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc | 
| index 582bde5f26216f645340ef2102d87e485ff2fafb..b802d7bab616d2ffc1b4ca2cff154a02b8ff4495 100644 | 
| --- a/webrtc/voice_engine/channel.cc | 
| +++ b/webrtc/voice_engine/channel.cc | 
| @@ -674,7 +674,7 @@ MixerParticipant::AudioFrameInfo Channel::GetAudioFrameWithMuted( | 
| rtp_ts_wraparound_handler_->Unwrap(audioFrame->timestamp_); | 
| audioFrame->elapsed_time_ms_ = | 
| (unwrap_timestamp - capture_start_rtp_time_stamp_) / | 
| - (GetPlayoutFrequency() / 1000); | 
| + (GetPayloadFrequency() / 1000); | 
| { | 
| rtc::CritScope lock(&ts_stats_lock_); | 
| @@ -3080,7 +3080,7 @@ void Channel::UpdatePlayoutTimestamp(bool rtcp) { | 
| uint32_t playout_timestamp = *jitter_buffer_playout_timestamp_; | 
| // Remove the playout delay. | 
| - playout_timestamp -= (delay_ms * (GetPlayoutFrequency() / 1000)); | 
| + playout_timestamp -= (delay_ms * (GetPayloadFrequency() / 1000)); | 
| WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), | 
| "Channel::UpdatePlayoutTimestamp() => playoutTimestamp = %lu", | 
| @@ -3140,25 +3140,12 @@ int Channel::SetSendRtpHeaderExtension(bool enable, | 
| return error; | 
| } | 
| -int32_t Channel::GetPlayoutFrequency() const { | 
| - int32_t playout_frequency = audio_coding_->PlayoutFrequency(); | 
| - CodecInst current_recive_codec; | 
| - if (audio_coding_->ReceiveCodec(¤t_recive_codec) == 0) { | 
| - if (STR_CASE_CMP("G722", current_recive_codec.plname) == 0) { | 
| - // Even though the actual sampling rate for G.722 audio is | 
| - // 16,000 Hz, the RTP clock rate for the G722 payload format is | 
| - // 8,000 Hz because that value was erroneously assigned in | 
| - // RFC 1890 and must remain unchanged for backward compatibility. | 
| - playout_frequency = 8000; | 
| - } else if (STR_CASE_CMP("opus", current_recive_codec.plname) == 0) { | 
| - // We are resampling Opus internally to 32,000 Hz until all our | 
| - // DSP routines can operate at 48,000 Hz, but the RTP clock | 
| - // rate for the Opus payload format is standardized to 48,000 Hz, | 
| - // because that is the maximum supported decoding sampling rate. | 
| - playout_frequency = 48000; | 
| - } | 
| - } | 
| - return playout_frequency; | 
| +int32_t Channel::GetPayloadFrequency() const { | 
| + CodecInst current_receive_codec; | 
| + RTC_CHECK_EQ(0, audio_coding_->ReceiveCodec(¤t_receive_codec)) | 
| + << "GetPayloadFrequency cannot be called before we have a received a " | 
| + "payload"; | 
| + return current_receive_codec.plfreq; | 
| 
 
kwiberg-webrtc
2016/09/20 15:34:54
CodecInst::plfreq is the actual sample rate of the
 
ossu
2016/09/20 15:43:51
Hmm ... no. I was quite sure of this when I made t
 
 | 
| } | 
| int64_t Channel::GetRTT(bool allow_associate_channel) const { |