diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-26 18:03:34 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-26 18:03:34 +0000 |
commit | d5bdce9f860bb4d87b5d51d1d202c59ec8b851b4 (patch) | |
tree | 7d3eb044d343ea0ca06682106455825ed7f0ad7b /media/audio | |
parent | 319dab11b1ee7e16b8f4089261f47d353aa8a466 (diff) | |
download | chromium_src-d5bdce9f860bb4d87b5d51d1d202c59ec8b851b4.zip chromium_src-d5bdce9f860bb4d87b5d51d1d202c59ec8b851b4.tar.gz chromium_src-d5bdce9f860bb4d87b5d51d1d202c59ec8b851b4.tar.bz2 |
Fix excessive IPCs by audio renderer.
BUG=60353
TEST=see repro steps in the bug.
Review URL: http://codereview.chromium.org/3973008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio')
-rw-r--r-- | media/audio/audio_output_controller.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/media/audio/audio_output_controller.cc b/media/audio/audio_output_controller.cc index a6317be..602e232 100644 --- a/media/audio/audio_output_controller.cc +++ b/media/audio/audio_output_controller.cc @@ -134,9 +134,14 @@ void AudioOutputController::SetVolume(double volume) { void AudioOutputController::EnqueueData(const uint8* data, uint32 size) { // Write data to the push source and ask for more data if needed. AutoLock auto_lock(lock_); - buffer_.Append(data, size); pending_request_ = false; - SubmitOnMoreData_Locked(); + // If |size| is set to 0, it indicates that the audio source doesn't have + // more data right now, and so it doesn't make sense to send additional + // request. + if (size) { + buffer_.Append(data, size); + SubmitOnMoreData_Locked(); + } } void AudioOutputController::DoCreate(AudioParameters params, |