Commit a0dbd846 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

winmm: Get rid of psStopEvent which was never used like an event.

parent ca37dbcf
...@@ -49,6 +49,7 @@ typedef struct tagWINE_PLAYSOUND ...@@ -49,6 +49,7 @@ typedef struct tagWINE_PLAYSOUND
} WINE_PLAYSOUND; } WINE_PLAYSOUND;
static WINE_PLAYSOUND *PlaySoundList; static WINE_PLAYSOUND *PlaySoundList;
static BOOL bPlaySoundStop;
static HMMIO get_mmioFromFile(LPCWSTR lpszName) static HMMIO get_mmioFromFile(LPCWSTR lpszName)
{ {
...@@ -426,7 +427,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg) ...@@ -426,7 +427,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
mmioSeek(hmmio, mmckInfo.dwDataOffset, SEEK_SET); mmioSeek(hmmio, mmckInfo.dwDataOffset, SEEK_SET);
while (left) while (left)
{ {
if (WaitForSingleObject(psStopEvent, 0) == WAIT_OBJECT_0) if (bPlaySoundStop)
{ {
waveOutReset(hWave); waveOutReset(hWave);
wps->bLoop = FALSE; wps->bLoop = FALSE;
...@@ -495,13 +496,13 @@ static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSo ...@@ -495,13 +496,13 @@ static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSo
ResetEvent(psLastEvent); ResetEvent(psLastEvent);
/* FIXME: doc says we have to stop all instances of pszSound if it's non /* FIXME: doc says we have to stop all instances of pszSound if it's non
* NULL... as of today, we stop all playing instances */ * NULL... as of today, we stop all playing instances */
SetEvent(psStopEvent); bPlaySoundStop = TRUE;
LeaveCriticalSection(&WINMM_cs); LeaveCriticalSection(&WINMM_cs);
WaitForSingleObject(psLastEvent, INFINITE); WaitForSingleObject(psLastEvent, INFINITE);
EnterCriticalSection(&WINMM_cs); EnterCriticalSection(&WINMM_cs);
ResetEvent(psStopEvent); bPlaySoundStop = FALSE;
} }
if (wps) wps->lpNext = PlaySoundList; if (wps) wps->lpNext = PlaySoundList;
......
...@@ -63,7 +63,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winmm); ...@@ -63,7 +63,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winmm);
HINSTANCE hWinMM32Instance; HINSTANCE hWinMM32Instance;
HANDLE psLastEvent; HANDLE psLastEvent;
HANDLE psStopEvent;
static CRITICAL_SECTION_DEBUG critsect_debug = static CRITICAL_SECTION_DEBUG critsect_debug =
{ {
...@@ -79,7 +78,6 @@ CRITICAL_SECTION WINMM_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; ...@@ -79,7 +78,6 @@ CRITICAL_SECTION WINMM_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
static BOOL WINMM_CreateIData(HINSTANCE hInstDLL) static BOOL WINMM_CreateIData(HINSTANCE hInstDLL)
{ {
hWinMM32Instance = hInstDLL; hWinMM32Instance = hInstDLL;
psStopEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
psLastEvent = CreateEventW(NULL, TRUE, FALSE, NULL); psLastEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
return TRUE; return TRUE;
} }
...@@ -93,7 +91,6 @@ static void WINMM_DeleteIData(void) ...@@ -93,7 +91,6 @@ static void WINMM_DeleteIData(void)
/* FIXME: should also free content and resources allocated /* FIXME: should also free content and resources allocated
* inside WINMM_IData */ * inside WINMM_IData */
CloseHandle(psStopEvent);
CloseHandle(psLastEvent); CloseHandle(psLastEvent);
DeleteCriticalSection(&WINMM_cs); DeleteCriticalSection(&WINMM_cs);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment