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

Unified Diff: webrtc/modules/audio_coding/neteq/decoder_database.cc

Issue 2071003003: Imported Optional from Chromium with some modifications. Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added an empty member to the OptionalStorage union, to make the union always initializable. Created 4 years, 6 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
« no previous file with comments | « webrtc/base/template_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/decoder_database.cc
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database.cc b/webrtc/modules/audio_coding/neteq/decoder_database.cc
index 165522f0dffb0851ad117e62654e2b60d5185f66..d5d3af4a4754e762a1077bfa2f8b58389dcd60a8 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database.cc
+++ b/webrtc/modules/audio_coding/neteq/decoder_database.cc
@@ -65,21 +65,17 @@ AudioDecoder* DecoderDatabase::DecoderInfo::GetDecoder(
rtc::Optional<DecoderDatabase::DecoderInfo::CngDecoder>
DecoderDatabase::DecoderInfo::CngDecoder::Create(NetEqDecoder ct) {
- const auto cng = [](int sample_rate_hz) {
- return rtc::Optional<DecoderDatabase::DecoderInfo::CngDecoder>(
- {sample_rate_hz});
- };
switch (ct) {
case NetEqDecoder::kDecoderCNGnb:
- return cng(8000);
+ return CngDecoder{8000};
case NetEqDecoder::kDecoderCNGwb:
- return cng(16000);
+ return CngDecoder{16000};
case NetEqDecoder::kDecoderCNGswb32kHz:
- return cng(32000);
+ return CngDecoder{32000};
case NetEqDecoder::kDecoderCNGswb48kHz:
- return cng(48000);
+ return CngDecoder{48000};
default:
- return rtc::Optional<DecoderDatabase::DecoderInfo::CngDecoder>();
+ return rtc::nullopt;
}
}
« no previous file with comments | « webrtc/base/template_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698