diff options
Diffstat (limited to 'modules/audio_coding/neteq/neteq_impl.cc')
-rw-r--r-- | modules/audio_coding/neteq/neteq_impl.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index d156352a26..e9ddbb92a1 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -258,6 +258,7 @@ void SetAudioFrameActivityAndType(bool vad_enabled, int NetEqImpl::GetAudio(AudioFrame* audio_frame, bool* muted, + int* current_sample_rate_hz, absl::optional<Operation> action_override) { TRACE_EVENT0("webrtc", "NetEqImpl::GetAudio"); MutexLock lock(&mutex_); @@ -296,6 +297,11 @@ int NetEqImpl::GetAudio(AudioFrame* audio_frame, } } + if (current_sample_rate_hz) { + *current_sample_rate_hz = delayed_last_output_sample_rate_hz_.value_or( + last_output_sample_rate_hz_); + } + return kOK; } @@ -565,19 +571,19 @@ int NetEqImpl::InsertPacketInternal(const RTPHeader& rtp_header, return kInvalidPointer; } - int64_t receive_time_ms = clock_->TimeInMilliseconds(); + Timestamp receive_time = clock_->CurrentTime(); stats_->ReceivedPacket(); PacketList packet_list; // Insert packet in a packet list. - packet_list.push_back([&rtp_header, &payload, &receive_time_ms] { + packet_list.push_back([&rtp_header, &payload, &receive_time] { // Convert to Packet. Packet packet; packet.payload_type = rtp_header.payloadType; packet.sequence_number = rtp_header.sequenceNumber; packet.timestamp = rtp_header.timestamp; packet.payload.SetData(payload.data(), payload.size()); - packet.packet_info = RtpPacketInfo(rtp_header, receive_time_ms); + packet.packet_info = RtpPacketInfo(rtp_header, receive_time); // Waiting time will be set upon inserting the packet in the buffer. RTC_DCHECK(!packet.waiting_time); return packet; |