diff options
Diffstat (limited to 'media/audio/audio_output_controller.cc')
-rw-r--r-- | media/audio/audio_output_controller.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/media/audio/audio_output_controller.cc b/media/audio/audio_output_controller.cc index 11ee96c..74e2261 100644 --- a/media/audio/audio_output_controller.cc +++ b/media/audio/audio_output_controller.cc @@ -212,9 +212,7 @@ void AudioOutputController::DoPlay() { } // We start the AudioOutputStream lazily. - if (old_state == kCreated) { - stream_->Start(this); - } + stream_->Start(this); // Tell the event handler that we are now playing. handler_->OnPlaying(this); @@ -228,12 +226,16 @@ void AudioOutputController::DoPause() { return; // Sets the |state_| to kPaused so we don't draw more audio data. - // TODO(hclam): Actually pause the audio device. { AutoLock auto_lock(lock_); state_ = kPaused; } + // Then we stop the audio device. This is not the perfect solution because + // it discards all the internal buffer in the audio device. + // TODO(hclam): Actually pause the audio device. + stream_->Stop(); + handler_->OnPaused(this); } |