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

Unified Diff: webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc

Issue 1476743002: Move the FEC enabling logic from CodecManager to Rent-A-Codec (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@rac0
Patch Set: Created 5 years, 1 month 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/main/acm2/rent_a_codec.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
index b31092cb1129427ac05a495b4966797a081dc733..229d367f6139115e9b377a11fff680d3630f35a4 100644
--- a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
+++ b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
@@ -253,6 +253,16 @@ AudioEncoder* RentACodec::RentEncoderStack(AudioEncoder* speech_encoder,
StackParameters* param) {
RTC_DCHECK(speech_encoder);
+ if (param->use_codec_fec) {
+ // Switch FEC on. On failure, remember that FEC is off.
+ if (!speech_encoder->SetFec(true))
+ param->use_codec_fec = false;
+ } else {
+ // Switch FEC off. This shouldn't fail.
+ const bool success = speech_encoder->SetFec(false);
+ RTC_DCHECK(success);
+ }
+
auto pt = [&speech_encoder](const std::map<int, int>& m) {
auto it = m.find(speech_encoder->SampleRateHz());
return it == m.end() ? rtc::Optional<int>()
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/codec_manager.cc ('k') | webrtc/modules/audio_coding/main/acm2/rent_a_codec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698