summaryrefslogtreecommitdiffstats
path: root/media/audio
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-17 22:07:18 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-17 22:07:18 +0000
commit3fa131ed261627dbf01646ff4d5a1194492aaaac (patch)
tree36e397339884c8cd4930f7df233960662cf4a9b3 /media/audio
parent75b63322f51d75b8c5b785ce067f53e21111cc2e (diff)
downloadchromium_src-3fa131ed261627dbf01646ff4d5a1194492aaaac.zip
chromium_src-3fa131ed261627dbf01646ff4d5a1194492aaaac.tar.gz
chromium_src-3fa131ed261627dbf01646ff4d5a1194492aaaac.tar.bz2
Pause for <video> should have immediate effect on audio
BUG=20351 A bug found while fixing mac audio. IPCAudioSouce transist to a wrong state after Play() is called. Resulting to pause having no effect. This will solve the problem of audio keeps playing a while after it is paused. Review URL: http://codereview.chromium.org/193095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio')
-rw-r--r--media/audio/win/waveout_output_win.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/media/audio/win/waveout_output_win.cc b/media/audio/win/waveout_output_win.cc
index 21532b7..2411527 100644
--- a/media/audio/win/waveout_output_win.cc
+++ b/media/audio/win/waveout_output_win.cc
@@ -142,6 +142,7 @@ void PCMWaveOutAudioOutputStream::Start(AudioSourceCallback* callback) {
return;
callback_ = callback;
state_ = PCMA_PLAYING;
+ pending_bytes_ = 0;
WAVEHDR* buffer = buffer_;
for (int ix = 0; ix != kNumBuffers; ++ix) {
QueueNextPacket(buffer); // Read more data.
@@ -172,8 +173,8 @@ void PCMWaveOutAudioOutputStream::Start(AudioSourceCallback* callback) {
}
// Stopping is tricky. First, no buffer should be locked by the audio driver
-// or else the waveOutReset will deadlock and secondly, the callback should not
-// be inside the AudioSource's OnMoreData because waveOutReset() forcefully
+// or else the waveOutReset() will deadlock and secondly, the callback should
+// not be inside the AudioSource's OnMoreData because waveOutReset() forcefully
// kills the callback thread.
void PCMWaveOutAudioOutputStream::Stop() {
if (state_ != PCMA_PLAYING)