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

Unified Diff: webrtc/modules/audio_coding/acm2/audio_coding_module.cc

Issue 2870043003: Handle padded audio packets correctly (Closed)
Patch Set: Add TODO bug for NACK Created 3 years, 7 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
Index: webrtc/modules/audio_coding/acm2/audio_coding_module.cc
diff --git a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
index e22eb5a5914cc4d5ba565659dc4e205eda41672d..252732a331d84e5b91752a1b4adf68bd8b002cfe 100644
--- a/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
+++ b/webrtc/modules/audio_coding/acm2/audio_coding_module.cc
@@ -1079,6 +1079,11 @@ rtc::Optional<SdpAudioFormat> AudioCodingModuleImpl::ReceiveFormat() const {
int AudioCodingModuleImpl::IncomingPacket(const uint8_t* incoming_payload,
minyue-webrtc 2017/05/09 21:04:06 will this affect DTX sync packets?
hlundin-webrtc 2017/05/10 08:57:23 Aren't they 1 or 2 bytes? https://cs.chromium.org
minyue-webrtc 2017/05/10 09:44:12 Yes. Thanks
const size_t payload_length,
const WebRtcRTPHeader& rtp_header) {
+ if (payload_length == 0) {
+ // This is an empty packet, which is not a problem, but we will have to
+ // construct an empty ArrayView.
+ return receiver_.InsertPacket(rtp_header, rtc::ArrayView<const uint8_t>());
+ }
return receiver_.InsertPacket(
rtp_header,
minyue-webrtc 2017/05/09 21:04:06 reading rtc::ArrayView i think it is safe to just
hlundin-webrtc 2017/05/10 08:57:23 I don't think so. If we construct an ArrayView wit
minyue-webrtc 2017/05/10 09:44:11 But shouldn't incoming_payload be a null?
hlundin-webrtc 2017/05/10 11:19:30 Done.
rtc::ArrayView<const uint8_t>(incoming_payload, payload_length));

Powered by Google App Engine
This is Rietveld 408576698