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..fce6bd7a086d31d171e5274453e72a899c4cf063 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::IsSupportedNumChannels(*cid, send_codec.channels) |
+ : rtc::Maybe<bool>(); |
+ }(); |
+ if (!supported_num_channels) |
+ return -1; |
+ if (!*supported_num_channels) { |
tommi
2015/11/03 14:20:19
Are these 8 lines, basically doing the same as the
kwiberg-webrtc
2015/11/03 15:13:27
Almost. Without the lambda, it looks like this if
tommi
2015/11/03 16:50:01
Somehow I missed that |auto| was rtc::Maybe too.
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, dummy_id, |
"%d number of channels not supportedn for %s.", |
send_codec.channels, send_codec.plname); |