Avoid triggering a false error logging when using encryptor and sending DTX.
Bug: b/135554070 Change-Id: I82e97da6fedd3fdbe90176dbec8eda524ad20624 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/143170 Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Commit-Queue: Minyue Li <minyue@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28351}
This commit is contained in:
@ -516,7 +516,8 @@ int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType,
|
|||||||
// DTMF, or the encoder entered DTX.
|
// DTMF, or the encoder entered DTX.
|
||||||
// TODO(minyue): see whether DTMF packets should be encrypted or not. In
|
// TODO(minyue): see whether DTMF packets should be encrypted or not. In
|
||||||
// current implementation, they are not.
|
// current implementation, they are not.
|
||||||
if (frame_encryptor_ != nullptr && !payload.empty()) {
|
if (!payload.empty()) {
|
||||||
|
if (frame_encryptor_ != nullptr) {
|
||||||
// TODO(benwright@webrtc.org) - Allocate enough to always encrypt inline.
|
// TODO(benwright@webrtc.org) - Allocate enough to always encrypt inline.
|
||||||
// Allocate a buffer to hold the maximum possible encrypted payload.
|
// Allocate a buffer to hold the maximum possible encrypted payload.
|
||||||
size_t max_ciphertext_size = frame_encryptor_->GetMaxCiphertextByteSize(
|
size_t max_ciphertext_size = frame_encryptor_->GetMaxCiphertextByteSize(
|
||||||
@ -530,7 +531,8 @@ int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType,
|
|||||||
/*additional_data=*/nullptr, payload, encrypted_audio_payload,
|
/*additional_data=*/nullptr, payload, encrypted_audio_payload,
|
||||||
&bytes_written);
|
&bytes_written);
|
||||||
if (encrypt_status != 0) {
|
if (encrypt_status != 0) {
|
||||||
RTC_DLOG(LS_ERROR) << "Channel::SendData() failed encrypt audio payload: "
|
RTC_DLOG(LS_ERROR)
|
||||||
|
<< "Channel::SendData() failed encrypt audio payload: "
|
||||||
<< encrypt_status;
|
<< encrypt_status;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -543,6 +545,7 @@ int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType,
|
|||||||
<< "A frame encryptor is required but one is not set.";
|
<< "A frame encryptor is required but one is not set.";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Push data from ACM to RTP/RTCP-module to deliver audio frame for
|
// Push data from ACM to RTP/RTCP-module to deliver audio frame for
|
||||||
// packetization.
|
// packetization.
|
||||||
|
Reference in New Issue
Block a user