diff --git a/audio/BUILD.gn b/audio/BUILD.gn index a7baf4db2e..199061586b 100644 --- a/audio/BUILD.gn +++ b/audio/BUILD.gn @@ -97,6 +97,7 @@ rtc_library("audio") { "../rtc_base:rate_limiter", "../rtc_base:refcount", "../rtc_base:rtc_event", + "../rtc_base:rtc_numerics", "../rtc_base:rtc_task_queue", "../rtc_base:safe_conversions", "../rtc_base:safe_minmax", diff --git a/audio/channel_receive.cc b/audio/channel_receive.cc index 0562d66c78..f884e39aa7 100644 --- a/audio/channel_receive.cc +++ b/audio/channel_receive.cc @@ -44,6 +44,7 @@ #include "rtc_base/checks.h" #include "rtc_base/logging.h" #include "rtc_base/numerics/safe_minmax.h" +#include "rtc_base/numerics/sequence_number_unwrapper.h" #include "rtc_base/race_checker.h" #include "rtc_base/synchronization/mutex.h" #include "rtc_base/system/no_unique_address.h" @@ -265,7 +266,7 @@ class ChannelReceive : public ChannelReceiveInterface, mutable Mutex ts_stats_lock_; - std::unique_ptr rtp_ts_wraparound_handler_; + webrtc::RtpTimestampUnwrapper rtp_ts_wraparound_handler_; // The rtp timestamp of the first played out audio frame. int64_t capture_start_rtp_time_stamp_; // The capture ntp time (in local timebase) of the first played out audio @@ -448,7 +449,7 @@ AudioMixer::Source::AudioFrameInfo ChannelReceive::GetAudioFrameWithInfo( // audio_frame.timestamp_ should be valid from now on. // Compute elapsed time. int64_t unwrap_timestamp = - rtp_ts_wraparound_handler_->Unwrap(audio_frame->timestamp_); + rtp_ts_wraparound_handler_.Unwrap(audio_frame->timestamp_); audio_frame->elapsed_time_ms_ = (unwrap_timestamp - capture_start_rtp_time_stamp_) / (GetRtpTimestampRateHz() / 1000); @@ -554,7 +555,6 @@ ChannelReceive::ChannelReceive( ntp_estimator_(clock), playout_timestamp_rtp_(0), playout_delay_ms_(0), - rtp_ts_wraparound_handler_(new rtc::TimestampWrapAroundHandler()), capture_start_rtp_time_stamp_(-1), capture_start_ntp_time_ms_(-1), _audioDeviceModulePtr(audio_device_module),