diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-21 00:54:18 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-21 00:54:18 +0000 |
commit | 4e27e40f5506493ab9a0bf120ae333848a777800 (patch) | |
tree | aaf8b3333cf20a677b61e1ea8948d03c4fb69607 /chrome/renderer/media | |
parent | 7904c65f88ac1e031d25ee97f9d2f776166c0b39 (diff) | |
download | chromium_src-4e27e40f5506493ab9a0bf120ae333848a777800.zip chromium_src-4e27e40f5506493ab9a0bf120ae333848a777800.tar.gz chromium_src-4e27e40f5506493ab9a0bf120ae333848a777800.tar.bz2 |
Set state of a new audio stream to Paused until it start to play. Also added media layout tests in ui tests.
BUG=39825
TEST=sound is still playing (with and without autoplay).
Review URL: http://codereview.chromium.org/3160027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/media')
-rw-r--r-- | chrome/renderer/media/audio_renderer_impl.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/renderer/media/audio_renderer_impl.cc b/chrome/renderer/media/audio_renderer_impl.cc index 15a98a5..cb7779b5 100644 --- a/chrome/renderer/media/audio_renderer_impl.cc +++ b/chrome/renderer/media/audio_renderer_impl.cc @@ -165,8 +165,13 @@ void AudioRendererImpl::Play(media::FilterCallback* callback) { if (stopped_) return; - io_loop_->PostTask(FROM_HERE, - NewRunnableMethod(this, &AudioRendererImpl::PlayTask)); + if (GetPlaybackRate() != 0.0f) { + io_loop_->PostTask(FROM_HERE, + NewRunnableMethod(this, &AudioRendererImpl::PlayTask)); + } else { + io_loop_->PostTask(FROM_HERE, + NewRunnableMethod(this, &AudioRendererImpl::PauseTask)); + } } void AudioRendererImpl::SetVolume(float volume) { |