Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Unified Diff: webrtc/modules/audio_coding/test/PacketLossTest.cc

Issue 2390883004: Hooking up audio network adaptor to VoE. (Closed)
Patch Set: on Karl's comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698