Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
15ad749e
Commit
15ad749e
authored
Mar 26, 2011
by
Jörg Höhle
Committed by
Alexandre Julliard
Mar 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "winmm: Fix PlaySound so it doesn't block when another sound is already playing.".
This reverts commit
f44bc89b
. Let the player thread call waveOutReset itself instead.
parent
2f368cfa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
playsound.c
dlls/winmm/playsound.c
+10
-10
No files found.
dlls/winmm/playsound.c
View file @
15ad749e
...
...
@@ -45,7 +45,6 @@ typedef struct tagWINE_PLAYSOUND
HMODULE
hMod
;
DWORD
fdwSound
;
HANDLE
hThread
;
HWAVEOUT
hWave
;
struct
tagWINE_PLAYSOUND
*
lpNext
;
}
WINE_PLAYSOUND
;
...
...
@@ -271,6 +270,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
MMCKINFO
ckMainRIFF
;
MMCKINFO
mmckInfo
;
LPWAVEFORMATEX
lpWaveFormat
=
NULL
;
HWAVEOUT
hWave
=
0
;
LPWAVEHDR
waveHdr
=
NULL
;
INT
count
,
bufsize
,
left
,
index
;
struct
playsound_data
s
;
...
...
@@ -399,7 +399,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
s
.
hEvent
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
if
(
waveOutOpen
(
&
wps
->
hWave
,
WAVE_MAPPER
,
lpWaveFormat
,
(
DWORD_PTR
)
PlaySound_Callback
,
if
(
waveOutOpen
(
&
hWave
,
WAVE_MAPPER
,
lpWaveFormat
,
(
DWORD_PTR
)
PlaySound_Callback
,
(
DWORD_PTR
)
&
s
,
CALLBACK_FUNCTION
)
!=
MMSYSERR_NOERROR
)
goto
errCleanUp
;
...
...
@@ -413,8 +413,8 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
waveHdr
[
0
].
dwLoops
=
waveHdr
[
1
].
dwLoops
=
0L
;
waveHdr
[
0
].
dwFlags
=
waveHdr
[
1
].
dwFlags
=
0L
;
waveHdr
[
0
].
dwBufferLength
=
waveHdr
[
1
].
dwBufferLength
=
bufsize
;
if
(
waveOutPrepareHeader
(
wps
->
hWave
,
&
waveHdr
[
0
],
sizeof
(
WAVEHDR
))
||
waveOutPrepareHeader
(
wps
->
hWave
,
&
waveHdr
[
1
],
sizeof
(
WAVEHDR
)))
{
if
(
waveOutPrepareHeader
(
hWave
,
&
waveHdr
[
0
],
sizeof
(
WAVEHDR
))
||
waveOutPrepareHeader
(
hWave
,
&
waveHdr
[
1
],
sizeof
(
WAVEHDR
)))
{
goto
errCleanUp
;
}
...
...
@@ -429,6 +429,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
{
if
(
WaitForSingleObject
(
psStopEvent
,
0
)
==
WAIT_OBJECT_0
)
{
waveOutReset
(
hWave
);
wps
->
bLoop
=
FALSE
;
break
;
}
...
...
@@ -437,7 +438,7 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
left
-=
count
;
waveHdr
[
index
].
dwBufferLength
=
count
;
waveHdr
[
index
].
dwFlags
&=
~
WHDR_DONE
;
if
(
waveOutWrite
(
wps
->
hWave
,
&
waveHdr
[
index
],
sizeof
(
WAVEHDR
))
==
MMSYSERR_NOERROR
)
{
if
(
waveOutWrite
(
hWave
,
&
waveHdr
[
index
],
sizeof
(
WAVEHDR
))
==
MMSYSERR_NOERROR
)
{
index
^=
1
;
PlaySound_WaitDone
(
&
s
);
}
...
...
@@ -447,17 +448,17 @@ static DWORD WINAPI proc_PlaySound(LPVOID arg)
}
while
(
wps
->
bLoop
);
PlaySound_WaitDone
(
&
s
);
/* for last buffer */
waveOutReset
(
wps
->
hWave
);
waveOutReset
(
hWave
);
waveOutUnprepareHeader
(
wps
->
hWave
,
&
waveHdr
[
0
],
sizeof
(
WAVEHDR
));
waveOutUnprepareHeader
(
wps
->
hWave
,
&
waveHdr
[
1
],
sizeof
(
WAVEHDR
));
waveOutUnprepareHeader
(
hWave
,
&
waveHdr
[
0
],
sizeof
(
WAVEHDR
));
waveOutUnprepareHeader
(
hWave
,
&
waveHdr
[
1
],
sizeof
(
WAVEHDR
));
errCleanUp:
TRACE
(
"Done playing=%s => %s!
\n
"
,
debugstr_w
(
wps
->
pszSound
),
bRet
?
"ok"
:
"ko"
);
CloseHandle
(
s
.
hEvent
);
HeapFree
(
GetProcessHeap
(),
0
,
waveHdr
);
HeapFree
(
GetProcessHeap
(),
0
,
lpWaveFormat
);
if
(
wps
->
hWave
)
while
(
waveOutClose
(
wps
->
hWave
)
==
WAVERR_STILLPLAYING
)
Sleep
(
100
);
if
(
hWave
)
while
(
waveOutClose
(
hWave
)
==
WAVERR_STILLPLAYING
)
Sleep
(
100
);
if
(
hmmio
)
mmioClose
(
hmmio
,
0
);
PlaySound_Free
(
wps
);
...
...
@@ -494,7 +495,6 @@ static BOOL MULTIMEDIA_PlaySound(const void* pszSound, HMODULE hmod, DWORD fdwSo
* NULL... as of today, we stop all playing instances */
SetEvent
(
psStopEvent
);
waveOutReset
(
PlaySoundList
->
hWave
);
LeaveCriticalSection
(
&
WINMM_cs
);
WaitForSingleObject
(
psLastEvent
,
INFINITE
);
EnterCriticalSection
(
&
WINMM_cs
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment