Chromium Code Reviews| Index: media/audio/win/wavein_input_win.cc |
| diff --git a/media/audio/win/wavein_input_win.cc b/media/audio/win/wavein_input_win.cc |
| index fdc08b875d73e219b5fe3f0e189b9fda62d4182e..a3a6940b7b701be576419a9f4664215a25c039e7 100644 |
| --- a/media/audio/win/wavein_input_win.cc |
| +++ b/media/audio/win/wavein_input_win.cc |
| @@ -14,6 +14,10 @@ |
| #include "media/audio/audio_util.h" |
| #include "media/audio/win/audio_manager_win.h" |
| +namespace { |
| +const int kCallbackTimeout = 1000; // One second. |
|
Satish
2011/06/14 14:28:04
rename to kStopInputStreamCallbackTimeout to be mo
allanwoj
2011/06/14 15:03:12
Done.
|
| +} |
| + |
| // Our sound buffers are allocated once and kept in a linked list using the |
| // the WAVEHDR::dwUser variable. The last buffer points to the first buffer. |
| static WAVEHDR* GetNextBuffer(WAVEHDR* current) { |
| @@ -130,7 +134,8 @@ void PCMWaveInAudioInputStream::Stop() { |
| return; |
| state_ = kStateStopping; |
| // Wait for the callback to finish, it will signal us when ready to be reset. |
| - if (WAIT_OBJECT_0 != ::WaitForSingleObject(stopped_event_, INFINITE)) { |
| + if (WAIT_OBJECT_0 != |
| + ::WaitForSingleObject(stopped_event_, kCallbackTimeout)) { |
| HandleError(::GetLastError()); |
| return; |
| } |