Avoid encrypting empty audio packet.
Bug: b/132861665 Change-Id: I161ba8697ae88857927f27fa6d3914b7201fdeab Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/137049 Commit-Queue: Minyue Li <minyue@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28006}
This commit is contained in:
@ -495,6 +495,15 @@ int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType,
|
||||
uint8_t payloadType,
|
||||
uint32_t timeStamp,
|
||||
rtc::ArrayView<const uint8_t> payload) {
|
||||
if (payload.empty()) {
|
||||
if (frameType == AudioFrameType::kEmptyFrame) {
|
||||
// we don't send empty audio RTP packets
|
||||
// no error since we use it to drive DTMF when we use VAD
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (_includeAudioLevelIndication) {
|
||||
// Store current audio level in the RTP sender.
|
||||
// The level will be used in combination with voice-activity state
|
||||
|
@ -221,14 +221,6 @@ bool RTPSenderAudio::SendAudio(AudioFrameType frame_type,
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (payload_size == 0 || payload_data == NULL) {
|
||||
if (frame_type == AudioFrameType::kEmptyFrame) {
|
||||
// we don't send empty audio RTP packets
|
||||
// no error since we use it to drive DTMF when we use VAD
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<RtpPacketToSend> packet = rtp_sender_->AllocatePacket();
|
||||
packet->SetMarker(MarkerBit(frame_type, payload_type));
|
||||
|
Reference in New Issue
Block a user