Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1012)

Unified Diff: media/audio/win/waveout_output_win.cc

Issue 173022: Possible deadlock in PCM audio Start() method... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/win/audio_output_win_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/waveout_output_win.cc
===================================================================
--- media/audio/win/waveout_output_win.cc (revision 23602)
+++ media/audio/win/waveout_output_win.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -153,16 +153,26 @@
buffer = GetNextBuffer(buffer);
}
buffer = buffer_;
-
- // Send the buffers to the audio driver.
+ MMRESULT result = ::waveOutPause(waveout_);
+ if (result != MMSYSERR_NOERROR) {
+ HandleError(result);
+ return;
+ }
+ // Send the buffers to the audio driver. Note that the device is paused
+ // so we avoid entering the callback method while still here.
for (int ix = 0; ix != kNumBuffers; ++ix) {
- MMRESULT result = ::waveOutWrite(waveout_, buffer, sizeof(WAVEHDR));
+ result = ::waveOutWrite(waveout_, buffer, sizeof(WAVEHDR));
if (result != MMSYSERR_NOERROR) {
HandleError(result);
break;
}
buffer = GetNextBuffer(buffer);
}
+ result = ::waveOutRestart(waveout_);
+ if (result != MMSYSERR_NOERROR) {
+ HandleError(result);
+ return;
+ }
}
// Stopping is tricky. First, no buffer should be locked by the audio driver
« no previous file with comments | « media/audio/win/audio_output_win_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698