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

Side by Side Diff: chromecast/media/cma/backend/multizone_backend_unittest.cc

Issue 2677643002: [Chromecast] Fix unit test failures due to underflow. (Closed)
Patch Set: Created 3 years, 10 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 | « chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 void BufferFeeder::OnPushBufferComplete(BufferStatus status) { 262 void BufferFeeder::OnPushBufferComplete(BufferStatus status) {
263 DCHECK(thread_checker_.CalledOnValidThread()); 263 DCHECK(thread_checker_.CalledOnValidThread());
264 pending_buffer_ = nullptr; 264 pending_buffer_ = nullptr;
265 265
266 if (!effects_only_) { 266 if (!effects_only_) {
267 ASSERT_NE(status, MediaPipelineBackend::kBufferFailed); 267 ASSERT_NE(status, MediaPipelineBackend::kBufferFailed);
268 MediaPipelineBackend::AudioDecoder::RenderingDelay delay = 268 MediaPipelineBackend::AudioDecoder::RenderingDelay delay =
269 decoder_->GetRenderingDelay(); 269 decoder_->GetRenderingDelay();
270 270
271 if (delay.timestamp_microseconds != kNoTimestamp) { 271 if (delay.timestamp_microseconds == kNoTimestamp) {
272 next_push_playback_timestamp_ = kNoTimestamp;
273 } else {
272 if (next_push_playback_timestamp_ == kNoTimestamp) { 274 if (next_push_playback_timestamp_ == kNoTimestamp) {
273 next_push_playback_timestamp_ = 275 next_push_playback_timestamp_ =
274 delay.timestamp_microseconds + delay.delay_microseconds; 276 delay.timestamp_microseconds + delay.delay_microseconds;
275 } else { 277 } else {
276 int64_t expected_next_push_playback_timestamp = 278 int64_t expected_next_push_playback_timestamp =
277 next_push_playback_timestamp_ + last_push_length_us_; 279 next_push_playback_timestamp_ + last_push_length_us_;
278 next_push_playback_timestamp_ = 280 next_push_playback_timestamp_ =
279 delay.timestamp_microseconds + delay.delay_microseconds; 281 delay.timestamp_microseconds + delay.delay_microseconds;
280 int64_t error = next_push_playback_timestamp_ - 282 int64_t error = next_push_playback_timestamp_ -
281 expected_next_push_playback_timestamp; 283 expected_next_push_playback_timestamp;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 ::testing::Values(0.5f, 0.99f, 1.0f, 1.01f, 2.0f))); 393 ::testing::Values(0.5f, 0.99f, 1.0f, 1.01f, 2.0f)));
392 394
393 INSTANTIATE_TEST_CASE_P( 395 INSTANTIATE_TEST_CASE_P(
394 Optional, 396 Optional,
395 MultizoneBackendTest, 397 MultizoneBackendTest,
396 testing::Combine(::testing::Values(64000, 88200, 96000), 398 testing::Combine(::testing::Values(64000, 88200, 96000),
397 ::testing::Values(0.5f, 0.99f, 1.0f, 1.01f, 2.0f))); 399 ::testing::Values(0.5f, 0.99f, 1.0f, 1.01f, 2.0f)));
398 400
399 } // namespace media 401 } // namespace media
400 } // namespace chromecast 402 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cma/backend/alsa/stream_mixer_alsa_input_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698