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

Side by Side Diff: media/renderers/audio_renderer_impl.cc

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: Check track ids via track_id_to_demux_stream_map_ 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
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/renderers/audio_renderer_impl.h" 5 #include "media/renderers/audio_renderer_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 DoFlush_Locked(); 284 DoFlush_Locked();
285 } 285 }
286 286
287 void AudioRendererImpl::DoFlush_Locked() { 287 void AudioRendererImpl::DoFlush_Locked() {
288 DCHECK(task_runner_->BelongsToCurrentThread()); 288 DCHECK(task_runner_->BelongsToCurrentThread());
289 lock_.AssertAcquired(); 289 lock_.AssertAcquired();
290 290
291 DCHECK(!pending_read_); 291 DCHECK(!pending_read_);
292 DCHECK_EQ(state_, kFlushed); 292 DCHECK_EQ(state_, kFlushed);
293 293
294 ended_timestamp_ = kInfiniteDuration();
chcunningham 2016/06/24 23:32:55 This seems like the right thing - just curious how
servolk 2016/06/25 00:36:33 I've been testing this CL manually, trying a bunch
294 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone, 295 audio_buffer_stream_->Reset(base::Bind(&AudioRendererImpl::ResetDecoderDone,
295 weak_factory_.GetWeakPtr())); 296 weak_factory_.GetWeakPtr()));
296 } 297 }
297 298
298 void AudioRendererImpl::ResetDecoderDone() { 299 void AudioRendererImpl::ResetDecoderDone() {
299 DCHECK(task_runner_->BelongsToCurrentThread()); 300 DCHECK(task_runner_->BelongsToCurrentThread());
300 { 301 {
301 base::AutoLock auto_lock(lock_); 302 base::AutoLock auto_lock(lock_);
302 303
303 DCHECK_EQ(state_, kFlushed); 304 DCHECK_EQ(state_, kFlushed);
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 DCHECK_NE(buffering_state_, buffering_state); 960 DCHECK_NE(buffering_state_, buffering_state);
960 lock_.AssertAcquired(); 961 lock_.AssertAcquired();
961 buffering_state_ = buffering_state; 962 buffering_state_ = buffering_state;
962 963
963 task_runner_->PostTask( 964 task_runner_->PostTask(
964 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange, 965 FROM_HERE, base::Bind(&AudioRendererImpl::OnBufferingStateChange,
965 weak_factory_.GetWeakPtr(), buffering_state_)); 966 weak_factory_.GetWeakPtr(), buffering_state_));
966 } 967 }
967 968
968 } // namespace media 969 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698