Chromium Code Reviews| Index: webrtc/modules/audio_coding/main/acm2/acm_receiver.cc |
| diff --git a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc |
| index 34726ccb204b6f0b91f4f2736509743b463f55f4..52b81124e1902f80103771f2d4d897a24ef382b2 100644 |
| --- a/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc |
| +++ b/webrtc/modules/audio_coding/main/acm2/acm_receiver.cc |
| @@ -163,15 +163,14 @@ int AcmReceiver::current_sample_rate_hz() const { |
| } |
| int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header, |
| - const uint8_t* incoming_payload, |
| - size_t length_payload) { |
| + rtc::ArrayView<const uint8_t> incoming_payload) { |
| uint32_t receive_timestamp = 0; |
| const RTPHeader* header = &rtp_header.header; // Just a shorthand. |
| { |
| CriticalSectionScoped lock(crit_sect_.get()); |
| - const Decoder* decoder = RtpHeaderToDecoder(*header, incoming_payload); |
| + const Decoder* decoder = RtpHeaderToDecoder(*header, incoming_payload[0]); |
|
hlundin-webrtc
2015/11/10 10:14:35
What happens if it is empty?
kwiberg-webrtc
2015/11/10 10:27:58
We'll fail a DCHECK, and then proceed to read out
hlundin-webrtc
2015/11/11 14:55:53
Let's keep it as it is.
|
| if (!decoder) { |
| LOG_F(LS_ERROR) << "Payload-type " |
| << static_cast<int>(header->payloadType) |
| @@ -197,8 +196,8 @@ int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header, |
| } // |crit_sect_| is released. |
| - if (neteq_->InsertPacket(rtp_header, incoming_payload, length_payload, |
| - receive_timestamp) < 0) { |
| + if (neteq_->InsertPacket(rtp_header, incoming_payload, receive_timestamp) < |
| + 0) { |
| LOG(LERROR) << "AcmReceiver::InsertPacket " |
| << static_cast<int>(header->payloadType) |
| << " Failed to insert packet"; |
| @@ -512,14 +511,14 @@ void AcmReceiver::ResetInitialDelay() { |
| const AcmReceiver::Decoder* AcmReceiver::RtpHeaderToDecoder( |
| const RTPHeader& rtp_header, |
| - const uint8_t* payload) const { |
| + uint8_t payload_type) const { |
| auto it = decoders_.find(rtp_header.payloadType); |
| const auto red_index = |
| RentACodec::CodecIndexFromId(RentACodec::CodecId::kRED); |
| if (red_index && // This ensures that RED is defined in WebRTC. |
| it != decoders_.end() && it->second.acm_codec_id == *red_index) { |
| // This is a RED packet, get the payload of the audio codec. |
| - it = decoders_.find(payload[0] & 0x7F); |
| + it = decoders_.find(payload_type & 0x7F); |
| } |
| // Check if the payload is registered. |