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

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

Issue 10837032: Fix playback rate w/o audio. Remove unused SetPlaybackRate(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « media/base/audio_renderer_sink.h ('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 (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/filters/audio_renderer_impl.h" 5 #include "media/filters/audio_renderer_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 if (pending_read_ || state_ == kPaused) 299 if (pending_read_ || state_ == kPaused)
300 return; 300 return;
301 pending_read_ = true; 301 pending_read_ = true;
302 decoder_->Read(read_cb_); 302 decoder_->Read(read_cb_);
303 } 303 }
304 304
305 void AudioRendererImpl::SetPlaybackRate(float playback_rate) { 305 void AudioRendererImpl::SetPlaybackRate(float playback_rate) {
306 DCHECK_LE(0.0f, playback_rate); 306 DCHECK_LE(0.0f, playback_rate);
307 307
308 if (!stopped_) { 308 if (!stopped_) {
309 // Notify sink of new playback rate.
310 sink_->SetPlaybackRate(playback_rate);
311
312 // We have two cases here: 309 // We have two cases here:
313 // Play: GetPlaybackRate() == 0.0 && playback_rate != 0.0 310 // Play: GetPlaybackRate() == 0.0 && playback_rate != 0.0
314 // Pause: GetPlaybackRate() != 0.0 && playback_rate == 0.0 311 // Pause: GetPlaybackRate() != 0.0 && playback_rate == 0.0
315 if (GetPlaybackRate() == 0.0f && playback_rate != 0.0f) { 312 if (GetPlaybackRate() == 0.0f && playback_rate != 0.0f) {
316 DoPlay(); 313 DoPlay();
317 } else if (GetPlaybackRate() != 0.0f && playback_rate == 0.0f) { 314 } else if (GetPlaybackRate() != 0.0f && playback_rate == 0.0f) {
318 // Pause is easy, we can always pause. 315 // Pause is easy, we can always pause.
319 DoPause(); 316 DoPause();
320 } 317 }
321 } 318 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 case kUnderflow: 541 case kUnderflow:
545 case kRebuffering: 542 case kRebuffering:
546 case kStopped: 543 case kStopped:
547 if (status != PIPELINE_OK) 544 if (status != PIPELINE_OK)
548 error_cb_.Run(status); 545 error_cb_.Run(status);
549 return; 546 return;
550 } 547 }
551 } 548 }
552 549
553 } // namespace media 550 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_renderer_sink.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698