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

Unified Diff: webrtc/modules/audio_coding/neteq/packet_buffer.cc

Issue 2290153002: NetEq: Change member variables for current RTP types to rtc::Optionals (Closed)
Patch Set: Updates after review Created 4 years, 4 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/neteq/packet_buffer.cc
diff --git a/webrtc/modules/audio_coding/neteq/packet_buffer.cc b/webrtc/modules/audio_coding/neteq/packet_buffer.cc
index f1b898e34cf079f2590a823643ea9374fb13c94b..61cc9575d8f2fb7a55edf47ecd9d41a0db092d51 100644
--- a/webrtc/modules/audio_coding/neteq/packet_buffer.cc
+++ b/webrtc/modules/audio_coding/neteq/packet_buffer.cc
@@ -108,31 +108,34 @@ int PacketBuffer::InsertPacket(Packet* packet) {
return return_val;
}
-int PacketBuffer::InsertPacketList(PacketList* packet_list,
- const DecoderDatabase& decoder_database,
- uint8_t* current_rtp_payload_type,
- uint8_t* current_cng_rtp_payload_type) {
+int PacketBuffer::InsertPacketList(
+ PacketList* packet_list,
+ const DecoderDatabase& decoder_database,
+ rtc::Optional<uint8_t>* current_rtp_payload_type,
+ rtc::Optional<uint8_t>* current_cng_rtp_payload_type) {
bool flushed = false;
while (!packet_list->empty()) {
Packet* packet = packet_list->front();
if (decoder_database.IsComfortNoise(packet->header.payloadType)) {
- if (*current_cng_rtp_payload_type != 0xFF &&
- *current_cng_rtp_payload_type != packet->header.payloadType) {
+ if (*current_cng_rtp_payload_type &&
+ **current_cng_rtp_payload_type != packet->header.payloadType) {
// New CNG payload type implies new codec type.
- *current_rtp_payload_type = 0xFF;
+ *current_rtp_payload_type = rtc::Optional<uint8_t>();
Flush();
flushed = true;
}
- *current_cng_rtp_payload_type = packet->header.payloadType;
+ *current_cng_rtp_payload_type =
+ rtc::Optional<uint8_t>(packet->header.payloadType);
} else if (!decoder_database.IsDtmf(packet->header.payloadType)) {
// This must be speech.
- if (*current_rtp_payload_type != 0xFF &&
- *current_rtp_payload_type != packet->header.payloadType) {
- *current_cng_rtp_payload_type = 0xFF;
+ if (*current_rtp_payload_type &&
+ **current_rtp_payload_type != packet->header.payloadType) {
+ *current_cng_rtp_payload_type = rtc::Optional<uint8_t>();
Flush();
flushed = true;
}
- *current_rtp_payload_type = packet->header.payloadType;
+ *current_rtp_payload_type =
+ rtc::Optional<uint8_t>(packet->header.payloadType);
}
int return_val = InsertPacket(packet);
packet_list->pop_front();
« no previous file with comments | « webrtc/modules/audio_coding/neteq/packet_buffer.h ('k') | webrtc/modules/audio_coding/neteq/packet_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698