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

Unified Diff: webrtc/media/engine/webrtcvoiceengine.cc

Issue 2707133007: Pick a matching CN codec, rather than the first CN codec. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvoiceengine.cc
diff --git a/webrtc/media/engine/webrtcvoiceengine.cc b/webrtc/media/engine/webrtcvoiceengine.cc
index e0d9884e8f1b2939b777b9f61df6e4722636e9ce..66f60c268e412a6438d7e740ef597d7d89c2d2c4 100644
--- a/webrtc/media/engine/webrtcvoiceengine.cc
+++ b/webrtc/media/engine/webrtcvoiceengine.cc
@@ -1987,32 +1987,33 @@ bool WebRtcVoiceMediaChannel::SetSendCodecs(
// Loop through the codecs list again to find the CN codec.
// TODO(solenberg): Break out into a separate function?
- for (const AudioCodec& codec : codecs) {
+ for (const AudioCodec& cn_codec : codecs) {
ossu 2017/03/01 23:24:37 ossu: Add a check here for if external CN is at al
ossu 2017/03/02 00:44:48 No, wait, I'm mixing this up with changes I haven'
// Ignore codecs we don't know about. The negotiation step should prevent
// this, but double-check to be sure.
webrtc::CodecInst voe_codec = {0};
- if (!WebRtcVoiceEngine::ToCodecInst(codec, &voe_codec)) {
- LOG(LS_WARNING) << "Unknown codec " << ToString(codec);
+ if (!WebRtcVoiceEngine::ToCodecInst(cn_codec, &voe_codec)) {
+ LOG(LS_WARNING) << "Unknown codec " << ToString(cn_codec);
continue;
}
- if (IsCodec(codec, kCnCodecName)) {
+ if (IsCodec(cn_codec, kCnCodecName) &&
+ cn_codec.clockrate == codec->clockrate) {
minyue-webrtc 2017/02/27 08:19:54 I am not familiar with the reason of the way it is
ossu 2017/03/01 23:24:38 From refactoring this further in my injectable aud
// Turn voice activity detection/comfort noise on if supported.
// Set the wideband CN payload type appropriately.
// (narrowband always uses the static payload type 13).
int cng_plfreq = -1;
- switch (codec.clockrate) {
+ switch (cn_codec.clockrate) {
case 8000:
case 16000:
case 32000:
hlundin-webrtc 2017/02/27 08:00:52 You will have to check this, but I do think we can
ossu 2017/03/01 23:24:38 I think I recall the CN code dealing with that, no
ossu 2017/03/02 00:44:48 ... which isn't used in this part of the code yet.
- cng_plfreq = codec.clockrate;
+ cng_plfreq = cn_codec.clockrate;
break;
default:
- LOG(LS_WARNING) << "CN frequency " << codec.clockrate
+ LOG(LS_WARNING) << "CN frequency " << cn_codec.clockrate
<< " not supported.";
continue;
}
- send_codec_spec.cng_payload_type = codec.id;
+ send_codec_spec.cng_payload_type = cn_codec.id;
send_codec_spec.cng_plfreq = cng_plfreq;
break;
}
« no previous file with comments | « no previous file | webrtc/media/engine/webrtcvoiceengine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698