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

Unified Diff: webrtc/voice_engine/transmit_mixer.cc

Issue 2973083002: TransmitMixer: Check GetSendCodec return value. (Closed)
Patch Set: Created 3 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/transmit_mixer.cc
diff --git a/webrtc/voice_engine/transmit_mixer.cc b/webrtc/voice_engine/transmit_mixer.cc
index 6796f8457c5e5b3060920c6be9995b8f739612b2..21140ace713f9e4f65bb274c8752ba4c90f4ff3f 100644
--- a/webrtc/voice_engine/transmit_mixer.cc
+++ b/webrtc/voice_engine/transmit_mixer.cc
@@ -247,9 +247,13 @@ void TransmitMixer::GetSendCodecInfo(int* max_sample_rate,
Channel* channel = it.GetChannel();
if (channel->Sending()) {
CodecInst codec;
- channel->GetSendCodec(codec);
- *max_sample_rate = std::max(*max_sample_rate, codec.plfreq);
- *max_channels = std::max(*max_channels, codec.channels);
+ if (channel->GetSendCodec(codec) == 0) {
minyue-webrtc 2017/07/10 09:30:32 I found another usage of this, should that be take
ossu 2017/07/11 10:23:11 We could add a DCHECK there. From what I can see,
+ *max_sample_rate = std::max(*max_sample_rate, codec.plfreq);
+ *max_channels = std::max(*max_channels, codec.channels);
+ } else {
+ LOG(LS_WARNING) << "Unable to get send codec for channel "
minyue-webrtc 2017/07/10 09:30:32 If I understand correctly, this is not supposed to
ossu 2017/07/11 10:23:11 NOTREACHED after the logging, I presume? So we'll
+ << channel->ChannelId();
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698