OLD | NEW |
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/audio_renderer_mixer_input.h" | 5 #include "media/base/audio_renderer_mixer_input.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/audio_renderer_mixer.h" | 8 #include "media/base/audio_renderer_mixer.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 void AudioRendererMixerInput::Play() { | 55 void AudioRendererMixerInput::Play() { |
56 DCHECK(initialized_); | 56 DCHECK(initialized_); |
57 | 57 |
58 if (playing_) | 58 if (playing_) |
59 return; | 59 return; |
60 | 60 |
61 mixer_->AddMixerInput(this); | 61 mixer_->AddMixerInput(this); |
62 playing_ = true; | 62 playing_ = true; |
63 } | 63 } |
64 | 64 |
65 void AudioRendererMixerInput::Pause(bool /* flush */) { | 65 void AudioRendererMixerInput::Pause() { |
66 DCHECK(initialized_); | 66 DCHECK(initialized_); |
67 | 67 |
68 if (!playing_) | 68 if (!playing_) |
69 return; | 69 return; |
70 | 70 |
71 mixer_->RemoveMixerInput(this); | 71 mixer_->RemoveMixerInput(this); |
72 playing_ = false; | 72 playing_ = false; |
73 } | 73 } |
74 | 74 |
75 bool AudioRendererMixerInput::SetVolume(double volume) { | 75 bool AudioRendererMixerInput::SetVolume(double volume) { |
(...skipping 14 matching lines...) Expand all Loading... |
90 } | 90 } |
91 | 91 |
92 return frames_filled > 0 ? volume_ : 0; | 92 return frames_filled > 0 ? volume_ : 0; |
93 } | 93 } |
94 | 94 |
95 void AudioRendererMixerInput::OnRenderError() { | 95 void AudioRendererMixerInput::OnRenderError() { |
96 callback_->OnRenderError(); | 96 callback_->OnRenderError(); |
97 } | 97 } |
98 | 98 |
99 } // namespace media | 99 } // namespace media |
OLD | NEW |