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

Side by Side Diff: media/base/pipeline.cc

Issue 10907213: Adjust tsan suppressions for media::Pipeline due to r156011. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comments to code Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/valgrind/tsan/suppressions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/base/pipeline.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 void Pipeline::OnAudioTimeUpdate(TimeDelta time, TimeDelta max_time) { 353 void Pipeline::OnAudioTimeUpdate(TimeDelta time, TimeDelta max_time) {
354 DCHECK_LE(time.InMicroseconds(), max_time.InMicroseconds()); 354 DCHECK_LE(time.InMicroseconds(), max_time.InMicroseconds());
355 DCHECK(IsRunning()); 355 DCHECK(IsRunning());
356 base::AutoLock auto_lock(lock_); 356 base::AutoLock auto_lock(lock_);
357 357
358 if (!has_audio_) 358 if (!has_audio_)
359 return; 359 return;
360 if (waiting_for_clock_update_ && time < clock_->Elapsed()) 360 if (waiting_for_clock_update_ && time < clock_->Elapsed())
361 return; 361 return;
362 362
363 // TODO(scherkus): |state_| should only be accessed on pipeline thread, see
364 // http://crbug.com/137973
363 if (state_ == kSeeking) 365 if (state_ == kSeeking)
364 return; 366 return;
365 367
366 clock_->SetTime(time, max_time); 368 clock_->SetTime(time, max_time);
367 StartClockIfWaitingForTimeUpdate_Locked(); 369 StartClockIfWaitingForTimeUpdate_Locked();
368 } 370 }
369 371
370 void Pipeline::OnVideoTimeUpdate(TimeDelta max_time) { 372 void Pipeline::OnVideoTimeUpdate(TimeDelta max_time) {
371 DCHECK(IsRunning()); 373 DCHECK(IsRunning());
372 base::AutoLock auto_lock(lock_); 374 base::AutoLock auto_lock(lock_);
373 375
374 if (has_audio_) 376 if (has_audio_)
375 return; 377 return;
376 378
379 // TODO(scherkus): |state_| should only be accessed on pipeline thread, see
380 // http://crbug.com/137973
377 if (state_ == kSeeking) 381 if (state_ == kSeeking)
378 return; 382 return;
379 383
380 DCHECK(!waiting_for_clock_update_); 384 DCHECK(!waiting_for_clock_update_);
381 clock_->SetMaxTime(max_time); 385 clock_->SetMaxTime(max_time);
382 } 386 }
383 387
384 void Pipeline::SetDuration(TimeDelta duration) { 388 void Pipeline::SetDuration(TimeDelta duration) {
385 DCHECK(IsRunning()); 389 DCHECK(IsRunning());
386 media_log_->AddEvent( 390 media_log_->AddEvent(
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { 959 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() {
956 lock_.AssertAcquired(); 960 lock_.AssertAcquired();
957 if (!waiting_for_clock_update_) 961 if (!waiting_for_clock_update_)
958 return; 962 return;
959 963
960 waiting_for_clock_update_ = false; 964 waiting_for_clock_update_ = false;
961 clock_->Play(); 965 clock_->Play();
962 } 966 }
963 967
964 } // namespace media 968 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | tools/valgrind/tsan/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698