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

Unified Diff: webrtc/voice_engine/transmit_mixer.cc

Issue 2973083002: TransmitMixer: Check GetSendCodec return value. (Closed)
Patch Set: More checking in channel.cc and added TODOs. 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 | « webrtc/voice_engine/channel.cc ('k') | 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..956cebd428fc0efa976743f35e7f4a919fb0bcd9 100644
--- a/webrtc/voice_engine/transmit_mixer.cc
+++ b/webrtc/voice_engine/transmit_mixer.cc
@@ -247,9 +247,15 @@ 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);
+ // TODO(ossu): Investigate how this could happen. b/62909493
+ if (channel->GetSendCodec(codec) == 0) {
+ *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 "
+ << channel->ChannelId();
+ RTC_NOTREACHED();
+ }
}
}
}
« no previous file with comments | « webrtc/voice_engine/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698