Module: wine Branch: master Commit: a0dbd846c6cf111d20718170e9de2f7681d8fadf URL: http://source.winehq.org/git/wine.git/?a=commit;h=a0dbd846c6cf111d20718170e9...
Author: Jörg Höhle hoehle@users.sourceforge.net Date: Sat Mar 26 12:36:49 2011 +0100
winmm: Get rid of psStopEvent which was never used like an event.
---
dlls/winmm/playsound.c | 7 ++++--- dlls/winmm/winmm.c | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/winmm/playsound.c b/dlls/winmm/playsound.c index a6a3c87..3624124 100644 --- a/dlls/winmm/playsound.c +++ b/dlls/winmm/playsound.c @@ -49,6 +49,7 @@ typedef struct tagWINE_PLAYSOUND } WINE_PLAYSOUND;
static WINE_PLAYSOUND *PlaySoundList; +static BOOL bPlaySoundStop;
static HMMIO get_mmioFromFile(LPCWSTR lpszName) { @@ -426,7 +427,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg) mmioSeek(hmmio, mmckInfo.dwDataOffset, SEEK_SET); while (left) { - if (WaitForSingleObject(psStopEvent, 0) == WAIT_OBJECT_0) + if (bPlaySoundStop) { waveOutReset(hWave); wps->bLoop = FALSE; @@ -495,13 +496,13 @@ static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSo ResetEvent(psLastEvent); /* FIXME: doc says we have to stop all instances of pszSound if it's non * NULL... as of today, we stop all playing instances */ - SetEvent(psStopEvent); + bPlaySoundStop = TRUE;
LeaveCriticalSection(&WINMM_cs); WaitForSingleObject(psLastEvent, INFINITE); EnterCriticalSection(&WINMM_cs);
- ResetEvent(psStopEvent); + bPlaySoundStop = FALSE; }
if (wps) wps->lpNext = PlaySoundList; diff --git a/dlls/winmm/winmm.c b/dlls/winmm/winmm.c index 029a1c9..6d5950b 100644 --- a/dlls/winmm/winmm.c +++ b/dlls/winmm/winmm.c @@ -63,7 +63,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winmm);
HINSTANCE hWinMM32Instance; HANDLE psLastEvent; -HANDLE psStopEvent;
static CRITICAL_SECTION_DEBUG critsect_debug = { @@ -79,7 +78,6 @@ CRITICAL_SECTION WINMM_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; static BOOL WINMM_CreateIData(HINSTANCE hInstDLL) { hWinMM32Instance = hInstDLL; - psStopEvent = CreateEventW(NULL, TRUE, FALSE, NULL); psLastEvent = CreateEventW(NULL, TRUE, FALSE, NULL); return TRUE; } @@ -93,7 +91,6 @@ static void WINMM_DeleteIData(void)
/* FIXME: should also free content and resources allocated * inside WINMM_IData */ - CloseHandle(psStopEvent); CloseHandle(psLastEvent); DeleteCriticalSection(&WINMM_cs); }