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

Unified Diff: webrtc/voice_engine/channel.cc

Issue 1798903002: Relanding https://codereview.webrtc.org/1715883002/ in pieces. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added test case Created 4 years, 9 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/channel.cc
diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc
index 2c747af12ba5c71cb75202cff489735043718755..8f1d0c18bda724f40c6fd6a82ccc7b6c07347c41 100644
--- a/webrtc/voice_engine/channel.cc
+++ b/webrtc/voice_engine/channel.cc
@@ -361,7 +361,7 @@ void Channel::OnPlayTelephoneEvent(uint8_t event,
" volume=%u)",
event, lengthMs, volume);
- if (!_playOutbandDtmfEvent || (event > 15)) {
+ if (!_playOutbandDtmfEvent || event > 15) {
// Ignore callback since feedback is disabled or event is not a
// Dtmf tone event.
return;
@@ -2227,18 +2227,14 @@ int Channel::SendTelephoneEventOutband(int event, int duration_ms) {
return 0;
}
-int Channel::SetSendTelephoneEventPayloadType(unsigned char type) {
+int Channel::SetSendTelephoneEventPayloadType(int payload_type) {
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::SetSendTelephoneEventPayloadType()");
- if (type > 127) {
- _engineStatisticsPtr->SetLastError(
- VE_INVALID_ARGUMENT, kTraceError,
- "SetSendTelephoneEventPayloadType() invalid type");
- return -1;
- }
- CodecInst codec = {};
+ RTC_DCHECK_LE(0, payload_type);
+ RTC_DCHECK_GE(127, payload_type);
+ CodecInst codec = {0};
codec.plfreq = 8000;
- codec.pltype = type;
+ codec.pltype = payload_type;
memcpy(codec.plname, "telephone-event", 16);
if (_rtpRtcpModule->RegisterSendPayload(codec) != 0) {
_rtpRtcpModule->DeRegisterSendPayload(codec.pltype);
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698