[WINESYNC][WINMM] Get rid of psStopEvent which was never used like an event

Wine commit: a0dbd846c6cf111d20718170e9de2f7681d8fadf

author: Jörg Höhle <hoehle@users.sourceforge.net>
Sat, 26 Mar 2011 11:36:49 +0000 (12:36 +0100)

committer: Alexandre Julliard <julliard@winehq.org>
Wed, 30 Mar 2011 11:28:04 +0000 (13:28 +0200)
This commit is contained in:
Thamatip Chitpong 2023-06-14 08:11:01 +07:00 committed by Stanislav Motylkov
parent aae34dc827
commit ede1cf4264
2 changed files with 4 additions and 6 deletions

View file

@ -35,6 +35,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)
{ {
@ -501,7 +502,7 @@ static BOOL proc_PlaySound(WINE_PLAYSOUND *wps)
mmioSeek(wps->hmmio, mmckInfo.dwDataOffset, SEEK_SET); mmioSeek(wps->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;
@ -597,13 +598,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;

View file

@ -49,7 +49,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winmm);
HINSTANCE hWinMM32Instance; HINSTANCE hWinMM32Instance;
HANDLE psLastEvent; HANDLE psLastEvent;
HANDLE psStopEvent;
CRITICAL_SECTION WINMM_cs; CRITICAL_SECTION WINMM_cs;
@ -59,7 +58,6 @@ CRITICAL_SECTION WINMM_cs;
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);
InitializeCriticalSection(&WINMM_cs); InitializeCriticalSection(&WINMM_cs);
return TRUE; return TRUE;
@ -74,7 +72,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);
} }