| Index: webrtc/modules/pacing/packet_router.cc
|
| diff --git a/webrtc/modules/pacing/packet_router.cc b/webrtc/modules/pacing/packet_router.cc
|
| index af1d5595be9193f491058ab3b179a9161cfd5bec..65d6db7cb704015cb6dac0fa2e6f309fe93f8440 100644
|
| --- a/webrtc/modules/pacing/packet_router.cc
|
| +++ b/webrtc/modules/pacing/packet_router.cc
|
| @@ -30,7 +30,13 @@ void PacketRouter::AddRtpModule(RtpRtcp* rtp_module) {
|
| rtc::CritScope cs(&modules_crit_);
|
| RTC_DCHECK(std::find(rtp_modules_.begin(), rtp_modules_.end(), rtp_module) ==
|
| rtp_modules_.end());
|
| - rtp_modules_.push_back(rtp_module);
|
| + // Put modules which can use regular payload packets (over rtx) instead of
|
| + // padding first as it's less of a waste
|
| + if ((rtp_module->RtxSendStatus() & kRtxRedundantPayloads) > 0) {
|
| + rtp_modules_.push_front(rtp_module);
|
| + } else {
|
| + rtp_modules_.push_back(rtp_module);
|
| + }
|
| }
|
|
|
| void PacketRouter::RemoveRtpModule(RtpRtcp* rtp_module) {
|
| @@ -64,6 +70,7 @@ size_t PacketRouter::TimeToSendPadding(size_t bytes_to_send,
|
| RTC_DCHECK(pacer_thread_checker_.CalledOnValidThread());
|
| size_t total_bytes_sent = 0;
|
| rtc::CritScope cs(&modules_crit_);
|
| + // Rtp modules are ordered by which stream can most benefit from padding.
|
| for (RtpRtcp* module : rtp_modules_) {
|
| if (module->SendingMedia()) {
|
| size_t bytes_sent = module->TimeToSendPadding(
|
|
|