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

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

Issue 2609043002: Limit NetEqImpl::ExtractPackets to returning one CNG packet (Closed)
Patch Set: Created 3 years, 12 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/neteq_impl.cc
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl.cc b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
index 0fcd8428177a18a19690affbfc1081aa07b47802..592d2844e15b27f6ccc78d21b97803d38c42a390 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl.cc
@@ -1978,6 +1978,8 @@ int NetEqImpl::ExtractPackets(size_t required_samples,
prev_payload_type = packet->payload_type;
}
+ const bool has_cng_packet =
+ decoder_database_->IsComfortNoise(packet->payload_type);
// Store number of extracted samples.
size_t packet_duration = 0;
if (packet->frame) {
@@ -1986,7 +1988,7 @@ int NetEqImpl::ExtractPackets(size_t required_samples,
if (packet->priority.codec_level > 0) {
stats_.SecondaryDecodedSamples(rtc::checked_cast<int>(packet_duration));
}
- } else if (!decoder_database_->IsComfortNoise(packet->payload_type)) {
+ } else if (!has_cng_packet) {
LOG(LS_WARNING) << "Unknown payload type "
<< static_cast<int>(packet->payload_type);
RTC_NOTREACHED();
@@ -2005,7 +2007,8 @@ int NetEqImpl::ExtractPackets(size_t required_samples,
// Check what packet is available next.
next_packet = packet_buffer_->PeekNextPacket();
next_packet_available = false;
- if (next_packet && prev_payload_type == next_packet->payload_type) {
+ if (next_packet && prev_payload_type == next_packet->payload_type &&
+ !has_cng_packet) {
int16_t seq_no_diff = next_packet->sequence_number - prev_sequence_number;
size_t ts_diff = next_packet->timestamp - prev_timestamp;
if (seq_no_diff == 1 ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698