OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 return kUnknownPayloadType; | 136 return kUnknownPayloadType; |
137 } | 137 } |
138 // No splitting for a sync-packet. | 138 // No splitting for a sync-packet. |
139 if (packet->sync_packet) { | 139 if (packet->sync_packet) { |
140 ++it; | 140 ++it; |
141 continue; | 141 continue; |
142 } | 142 } |
143 | 143 |
144 // Not an FEC packet. | 144 // Not an FEC packet. |
145 AudioDecoder* decoder = decoder_database->GetDecoder(payload_type); | 145 AudioDecoder* decoder = decoder_database->GetDecoder(payload_type); |
146 // decoder should not return NULL. | 146 // decoder should not return NULL, except for CNG as that's no longer a |
147 assert(decoder != NULL); | 147 // Decoder. |
kwiberg-webrtc
2016/04/09 07:34:49
Please avoid referring to how things used to be, s
ossu
2016/04/11 08:31:10
Acknowledged.
| |
148 assert(decoder != NULL || decoder_database->IsComfortNoise(payload_type)); | |
148 if (!decoder || | 149 if (!decoder || |
149 !decoder->PacketHasFec(packet->payload, packet->payload_length)) { | 150 !decoder->PacketHasFec(packet->payload, packet->payload_length)) { |
150 ++it; | 151 ++it; |
151 continue; | 152 continue; |
152 } | 153 } |
153 | 154 |
154 switch (info->codec_type) { | 155 switch (info->codec_type) { |
155 case NetEqDecoder::kDecoderOpus: | 156 case NetEqDecoder::kDecoderOpus: |
156 case NetEqDecoder::kDecoderOpus_2ch: { | 157 case NetEqDecoder::kDecoderOpus_2ch: { |
157 // The main payload of this packet should be decoded as a primary | 158 // The main payload of this packet should be decoded as a primary |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 new_packet->payload = new uint8_t[bytes_per_frame]; | 433 new_packet->payload = new uint8_t[bytes_per_frame]; |
433 memcpy(new_packet->payload, payload_ptr, bytes_per_frame); | 434 memcpy(new_packet->payload, payload_ptr, bytes_per_frame); |
434 payload_ptr += bytes_per_frame; | 435 payload_ptr += bytes_per_frame; |
435 new_packets->push_back(new_packet); | 436 new_packets->push_back(new_packet); |
436 len -= bytes_per_frame; | 437 len -= bytes_per_frame; |
437 } | 438 } |
438 return kOK; | 439 return kOK; |
439 } | 440 } |
440 | 441 |
441 } // namespace webrtc | 442 } // namespace webrtc |
OLD | NEW |