Fixes TaskQueuePacedSender padding while only sending non-paced audio.
EnqueuePackets() would reset the last process time if the queue and media budgets were empty. This was done without reducing the padding debt. The result of this was that, given an existing debt, and an interval between audio packets that is less than the drain time for the padding debt, padding would not be sent at all. Now, before adding a new packet, we reduce the padding debt if the packet queue is empty. Bug: webrtc:10809 Change-Id: I116169522c215257febd32e17abab45f1a7d609f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/171808 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30949}
This commit is contained in:
@ -284,8 +284,9 @@ void PacingController::EnqueuePacketInternal(
|
||||
}
|
||||
|
||||
if (mode_ == ProcessMode::kDynamic && packet_queue_.Empty() &&
|
||||
media_debt_ == DataSize::Zero()) {
|
||||
last_process_time_ = CurrentTime();
|
||||
media_debt_.IsZero()) {
|
||||
TimeDelta elapsed_time = UpdateTimeAndGetElapsed(now);
|
||||
UpdateBudgetWithElapsedTime(elapsed_time);
|
||||
}
|
||||
packet_queue_.Push(priority, now, packet_counter_++, std::move(packet));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user