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); |