Check timestamp difference when choosing to extract multiple packets from the jitter buffer.
This fixes a bug where we sometimes extract an Opus CNG packet and the packet after, even though there was big timestamp gap between the packets, which causes expansion during the next GetAudio calls. Change-Id: I2409ac08df58afc496f74b91981657b7206e8bb1 Bug: webrtc:10167 Reviewed-on: https://webrtc-review.googlesource.com/c/115419 Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26179}
This commit is contained in:
committed by
Commit Bot
parent
278f82516f
commit
00a6ab568b
@ -1938,13 +1938,14 @@ int NetEqImpl::ExtractPackets(size_t required_samples,
|
||||
!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 ||
|
||||
(seq_no_diff == 0 && ts_diff == decoder_frame_length_)) {
|
||||
if ((seq_no_diff == 1 || seq_no_diff == 0) &&
|
||||
ts_diff <= packet_duration) {
|
||||
// The next sequence number is available, or the next part of a packet
|
||||
// that was split into pieces upon insertion.
|
||||
next_packet_available = true;
|
||||
}
|
||||
prev_sequence_number = next_packet->sequence_number;
|
||||
prev_timestamp = next_packet->timestamp;
|
||||
}
|
||||
} while (extracted_samples < required_samples && next_packet_available);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user