diff options
author | neb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 17:37:35 +0000 |
---|---|---|
committer | neb@chromium.org <neb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 17:37:35 +0000 |
commit | b0deb15a7c1769f0a9814e7ec64975b68c016638 (patch) | |
tree | ac9cfdbad7f996701dc0c6e9efcee0f4f91b2607 /media | |
parent | e2c6ef63f7a8f4b49b689099e92004ea27c268c0 (diff) | |
download | chromium_src-b0deb15a7c1769f0a9814e7ec64975b68c016638.zip chromium_src-b0deb15a7c1769f0a9814e7ec64975b68c016638.tar.gz chromium_src-b0deb15a7c1769f0a9814e7ec64975b68c016638.tar.bz2 |
Guarantee PPAPI Audio playbacks are stopped in Pause().
BUG=none
TEST=pepper audio demo is playing audio
Review URL: http://codereview.chromium.org/3142005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/audio/audio_output_controller.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/media/audio/audio_output_controller.cc b/media/audio/audio_output_controller.cc index 27938f9..45ad62c 100644 --- a/media/audio/audio_output_controller.cc +++ b/media/audio/audio_output_controller.cc @@ -13,6 +13,8 @@ static const uint32 kMaxHardwareBufferSize = 2 * kMegabytes; static const int kMaxChannels = 32; static const int kMaxBitsPerSample = 64; static const int kMaxSampleRate = 192000; +// Signal a pause in low-latency mode. +static const int kPauseMark = -1; // Return true if the parameters for creating an audio stream is valid. // Return false otherwise. @@ -239,6 +241,11 @@ void AudioOutputController::DoPause() { // TODO(hclam): Actually pause the audio device. stream_->Stop(); + if (LowLatencyMode()) { + // Send a special pause mark to the low-latency audio thread. + sync_reader_->UpdatePendingBytes(kPauseMark); + } + handler_->OnPaused(this); } |