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

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

Issue 1419013005: Hide ACMCodecDB::codec_settings_ behind an accessor (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
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/codec_manager.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/codec_manager.cc b/webrtc/modules/audio_coding/main/acm2/codec_manager.cc
index f9b77e898511ff2dd4d682ff085ba30c3d3e9d3b..7e9d71751dc60a10a00a780796ae91882a7b468d 100644
--- a/webrtc/modules/audio_coding/main/acm2/codec_manager.cc
+++ b/webrtc/modules/audio_coding/main/acm2/codec_manager.cc
@@ -63,8 +63,14 @@ int IsValidSendCodec(const CodecInst& send_codec, bool is_primary_encoder) {
return -1;
}
- if (ACMCodecDB::codec_settings_[codec_id].channel_support <
- send_codec.channels) {
+ const rtc::Maybe<bool> supported_num_channels = [codec_id, &send_codec] {
+ auto cid = RentACodec::CodecIdFromIndex(codec_id);
+ return cid ? RentACodec::SupportedNumChannels(*cid, send_codec.channels)
hlundin-webrtc 2015/11/03 08:48:55 While I think this code is correct, I got fooled a
kwiberg-webrtc 2015/11/03 09:32:03 IsSupportedNumChannels?
hlundin-webrtc 2015/11/03 10:00:47 IsABellNecessaryOnABike? Sounds good. Make it happ
+ : rtc::Maybe<bool>();
+ }();
+ if (!supported_num_channels)
+ return -1;
+ if (!*supported_num_channels) {
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id,
"%d number of channels not supportedn for %s.",
send_codec.channels, send_codec.plname);
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_codec_database.h ('k') | webrtc/modules/audio_coding/main/acm2/rent_a_codec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698