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

Side by Side Diff: webrtc/modules/audio_coding/neteq/delay_peak_detector_unittest.cc

Issue 2085233002: NetEq: Fix a bug in DelayPeakDetector causing asserts to trigger (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_coding/neteq/delay_peak_detector.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 int iat_packets = (arrival_times_ms[next] - arrival_times_ms[next - 1]) / 115 int iat_packets = (arrival_times_ms[next] - arrival_times_ms[next - 1]) /
116 kPacketSizeMs; 116 kPacketSizeMs;
117 const int kTargetBufferLevel = 2; // Define peaks to be iat > 4. 117 const int kTargetBufferLevel = 2; // Define peaks to be iat > 4.
118 EXPECT_FALSE(detector.Update(iat_packets, kTargetBufferLevel)); 118 EXPECT_FALSE(detector.Update(iat_packets, kTargetBufferLevel));
119 ++next; 119 ++next;
120 } 120 }
121 tick_timer.Increment(); 121 tick_timer.Increment();
122 time += 10; // Increase time 10 ms. 122 time += 10; // Increase time 10 ms.
123 } 123 }
124 } 124 }
125
126 // In situations with reordered packets, the DelayPeakDetector may be updated
127 // back-to-back (i.e., without the tick_timer moving) but still with non-zero
128 // inter-arrival time. This test is to make sure that this does not cause
129 // problems.
130 TEST(DelayPeakDetector, ZeroDistancePeaks) {
131 TickTimer tick_timer;
132 DelayPeakDetector detector(&tick_timer);
133 const int kPacketSizeMs = 30;
134 detector.SetPacketAudioLength(kPacketSizeMs);
135
136 const int kTargetBufferLevel = 2; // Define peaks to be iat > 4.
137 const int kInterArrivalTime = 3 * kTargetBufferLevel; // Will trigger a peak.
138 EXPECT_FALSE(detector.Update(kInterArrivalTime, kTargetBufferLevel));
139 EXPECT_FALSE(detector.Update(kInterArrivalTime, kTargetBufferLevel));
140 EXPECT_FALSE(detector.Update(kInterArrivalTime, kTargetBufferLevel));
141 }
142
125 } // namespace webrtc 143 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/delay_peak_detector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698