| Index: webrtc/modules/pacing/paced_sender.cc
|
| diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc
|
| index 7c24301b95f0d830af5effde988a9a182ac36d48..11d6596dfa67e734fa25e3fd12c8b98da3a82f7f 100644
|
| --- a/webrtc/modules/pacing/paced_sender.cc
|
| +++ b/webrtc/modules/pacing/paced_sender.cc
|
| @@ -264,7 +264,8 @@ PacedSender::PacedSender(const Clock* clock,
|
| time_last_update_us_(clock->TimeInMicroseconds()),
|
| first_sent_packet_ms_(-1),
|
| packets_(new paced_sender::PacketQueue(clock)),
|
| - packet_counter_(0) {
|
| + packet_counter_(0),
|
| + account_for_audio_(false) {
|
| UpdateBudgetWithElapsedTime(kMinPacketLimitMs);
|
| }
|
|
|
| @@ -351,6 +352,11 @@ void PacedSender::InsertPacket(RtpPacketSender::Priority priority,
|
| retransmission, packet_counter_++));
|
| }
|
|
|
| +void PacedSender::AccountForAudioPackets(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);
|
| @@ -502,9 +508,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.
|
| UpdateBudgetWithBytesSent(packet.bytes);
|
| }
|
|
|