From eaedde7e168c9c1ba38c5ca361541ceaab867d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Tue, 23 Feb 2021 17:34:01 +0100 Subject: [PATCH] Remove old workaround in PacingController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: I23f3548f21b464fe5e211c9895927ee0d978e1f8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208543 Reviewed-by: Philip Eliasson Commit-Queue: Erik Språng Cr-Commit-Position: refs/heads/master@{#33331} --- modules/pacing/paced_sender.cc | 1 + modules/pacing/pacing_controller.cc | 4 ---- modules/pacing/task_queue_paced_sender.cc | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/pacing/paced_sender.cc b/modules/pacing/paced_sender.cc index 57dbc4f248..51d3edc301 100644 --- a/modules/pacing/paced_sender.cc +++ b/modules/pacing/paced_sender.cc @@ -124,6 +124,7 @@ void PacedSender::EnqueuePackets( packet->SequenceNumber(), "rtp_timestamp", packet->Timestamp()); + RTC_DCHECK_GE(packet->capture_time_ms(), 0); pacing_controller_.EnqueuePacket(std::move(packet)); } } diff --git a/modules/pacing/pacing_controller.cc b/modules/pacing/pacing_controller.cc index 3ac7afa7ea..e0ace4e65e 100644 --- a/modules/pacing/pacing_controller.cc +++ b/modules/pacing/pacing_controller.cc @@ -295,11 +295,7 @@ void PacingController::EnqueuePacketInternal( int priority) { prober_.OnIncomingPacket(DataSize::Bytes(packet->payload_size())); - // TODO(sprang): Make sure tests respect this, replace with DCHECK. Timestamp now = CurrentTime(); - if (packet->capture_time_ms() < 0) { - packet->set_capture_time_ms(now.ms()); - } if (mode_ == ProcessMode::kDynamic && packet_queue_.Empty() && NextSendTime() <= now) { diff --git a/modules/pacing/task_queue_paced_sender.cc b/modules/pacing/task_queue_paced_sender.cc index 69ec5457ad..8ba49770d4 100644 --- a/modules/pacing/task_queue_paced_sender.cc +++ b/modules/pacing/task_queue_paced_sender.cc @@ -136,6 +136,7 @@ void TaskQueuePacedSender::EnqueuePackets( task_queue_.PostTask([this, packets_ = std::move(packets)]() mutable { RTC_DCHECK_RUN_ON(&task_queue_); for (auto& packet : packets_) { + RTC_DCHECK_GE(packet->capture_time_ms(), 0); pacing_controller_.EnqueuePacket(std::move(packet)); } MaybeProcessPackets(Timestamp::MinusInfinity());