Index: webrtc/modules/pacing/paced_sender.cc |
diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc |
index acfcd1fbffc98dcf94eddb90966fe3b353dd7c84..d2808a2f9cc828376208605d1641228af21827bc 100644 |
--- a/webrtc/modules/pacing/paced_sender.cc |
+++ b/webrtc/modules/pacing/paced_sender.cc |
@@ -256,7 +256,8 @@ PacedSender::PacedSender(const Clock* clock, |
packets_(new paced_sender::PacketQueue(clock)), |
packet_counter_(0), |
pacing_factor_(kDefaultPaceMultiplier), |
- queue_time_limit(kMaxQueueLengthMs) { |
+ queue_time_limit(kMaxQueueLengthMs), |
+ account_for_audio_(false) { |
UpdateBudgetWithElapsedTime(kMinPacketLimitMs); |
} |
@@ -347,6 +348,11 @@ void PacedSender::InsertPacket(RtpPacketSender::Priority priority, |
retransmission, packet_counter_++)); |
} |
+void PacedSender::SetAccountForAudioPackets(bool account_for_audio) { |
+ rtc::CritScope cs(&critsect_); |
+ account_for_audio_ = account_for_audio; |
+} |
+ |
int64_t PacedSender::ExpectedQueueTimeMs() const { |
rtc::CritScope cs(&critsect_); |
RTC_DCHECK_GT(pacing_bitrate_kbps_, 0); |
@@ -512,9 +518,7 @@ bool PacedSender::SendPacket(const paced_sender::Packet& packet, |
critsect_.Enter(); |
if (success) { |
- // TODO(holmer): High priority packets should only be accounted for if we |
- // are allocating bandwidth for audio. |
- if (packet.priority != kHighPriority) { |
+ if (packet.priority != kHighPriority || account_for_audio_) { |
// Update media bytes sent. |
// TODO(eladalon): TimeToSendPacket() can also return |true| in some |
// situations where nothing actually ended up being sent to the network, |