diff options
| author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 22:54:57 +0000 |
|---|---|---|
| committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 22:54:57 +0000 |
| commit | 0a33b90c45a0b1a139e3a655666ba337ecb600b0 (patch) | |
| tree | 0f1db73d94e9371b68513df44daaa563361b175b /media/audio/audio_output_controller.cc | |
| parent | 2941c23929d4fd1006c77926dd5d73ecbbe0524f (diff) | |
| download | chromium_src-0a33b90c45a0b1a139e3a655666ba337ecb600b0.zip chromium_src-0a33b90c45a0b1a139e3a655666ba337ecb600b0.tar.gz chromium_src-0a33b90c45a0b1a139e3a655666ba337ecb600b0.tar.bz2 | |
Audio pause and seek better
BUG=39885
Pause for audio is now in effect in less than 200ms.
Seek for audio is also much better as we play also very short amount
after seek.
Review URL: http://codereview.chromium.org/2931014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52560 0039d316-1c4b-4281-b951-d872f2087c98
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); } |
