Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 2142e5d

Browse files
taste1981jianjunz
authored andcommitted
Fix pacer issue with low latency mode (#75)
1 parent d03699a commit 2142e5d

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

modules/pacing/paced_sender.cc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ PacedSender::PacedSender(Clock* clock,
4040
ProcessThread* process_thread)
4141
: low_latency_mode_(field_trial::IsEnabled("OWT-LowLatencyMode")),
4242
process_mode_(
43-
(field_trials != nullptr &&
44-
absl::StartsWith(field_trials->Lookup("OWT-LowLatencyMode"),
45-
"Enabled"))
46-
? PacingController::ProcessMode::kRealtime
43+
low_latency_mode_?
44+
PacingController::ProcessMode::kRealtime
4745
: PacingController::ProcessMode::kPeriodic),
4846
pacing_controller_(clock,
4947
static_cast<PacingController::PacketSender*>(this),
@@ -207,8 +205,7 @@ void PacedSender::MaybeWakupProcessThread() {
207205
// Tell the process thread to call our TimeUntilNextProcess() method to get
208206
// a new time for when to call Process().
209207
if (process_thread_ &&
210-
(process_mode_ == PacingController::ProcessMode::kDynamic||
211-
process_mode_ == PacingController::ProcessMode::kRealtime)) {
208+
(process_mode_ == PacingController::ProcessMode::kDynamic)) {
212209
process_thread_->WakeUp(&module_proxy_);
213210
}
214211
}

modules/utility/source/process_thread_impl.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ void ProcessThreadImpl::Start() {
8686
}
8787

8888
void ProcessThreadImpl::StartWithHighPriority() {
89-
RTC_DCHECK(thread_checker_.CalledOnValidThread());
9089
RTC_DCHECK(!thread_.get());
9190
if (thread_.get())
9291
return;
@@ -96,10 +95,9 @@ void ProcessThreadImpl::StartWithHighPriority() {
9695
for (ModuleCallback& m : modules_)
9796
m.module->ProcessThreadAttached(this);
9897

99-
thread_.reset(
100-
new rtc::PlatformThread(&ProcessThreadImpl::Run, this, thread_name_));
98+
thread_.reset(new rtc::PlatformThread(&ProcessThreadImpl::Run, this,
99+
thread_name_, rtc::kRealtimePriority));
101100
thread_->Start();
102-
thread_->SetPriority(rtc::kRealtimePriority);
103101
}
104102

105103
void ProcessThreadImpl::Stop() {

0 commit comments

Comments
 (0)