Index: webrtc/modules/audio_coding/test/PacketLossTest.cc |
diff --git a/webrtc/modules/audio_coding/test/PacketLossTest.cc b/webrtc/modules/audio_coding/test/PacketLossTest.cc |
index 68f26150bced1c12e8957744459ae9dd36bbaa67..c368c3e2783dfa68e53af0531eee223532746a0a 100644 |
--- a/webrtc/modules/audio_coding/test/PacketLossTest.cc |
+++ b/webrtc/modules/audio_coding/test/PacketLossTest.cc |
@@ -103,11 +103,14 @@ bool SenderWithFEC::SetFEC(bool enable_fec) { |
} |
bool SenderWithFEC::SetPacketLossRate(int expected_loss_rate) { |
- if (_acm->SetPacketLossRate(expected_loss_rate) == 0) { |
- expected_loss_rate_ = expected_loss_rate; |
- return true; |
- } |
- return false; |
+ bool success = false; |
+ _acm->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) { |
+ if (*encoder) { |
+ (*encoder)->SetProjectedPacketLossRate(expected_loss_rate / 100.0f); |
+ success = true; |
+ } |
+ }); |
+ return success; |
} |
PacketLossTest::PacketLossTest(int channels, int expected_loss_rate, |