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

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

Issue 2390883004: Hooking up audio network adaptor to VoE. (Closed)
Patch Set: 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..ae489552aefdea7b213e12f381031107a5a0973c 100644
--- a/webrtc/modules/audio_coding/test/PacketLossTest.cc
+++ b/webrtc/modules/audio_coding/test/PacketLossTest.cc
@@ -103,11 +103,16 @@ 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) {
+ // There is no existing encoder.
+ return;
+ }
+ (*encoder)->SetProjectedPacketLossRate(expected_loss_rate / 100.0f);
+ success = true;
+ });
+ return success;
kwiberg-webrtc 2016/10/06 09:46:13 Excellent.
minyue-webrtc 2016/10/11 17:04:34 Hi Karl, I know that you liked this change, me to
}
PacketLossTest::PacketLossTest(int channels, int expected_loss_rate,

Powered by Google App Engine
This is Rietveld 408576698