Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoann Laissus
wine
Commits
29001b31
Commit
29001b31
authored
24 years ago
by
Eric Pouech
Committed by
Alexandre Julliard
24 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed reentrancy issues in play/stop operations.
parent
36706676
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/winmm/mciseq/mcimidi.c
+20
-9
20 additions, 9 deletions
dlls/winmm/mciseq/mcimidi.c
with
20 additions
and
9 deletions
dlls/winmm/mciseq/mcimidi.c
+
20
−
9
View file @
29001b31
...
...
@@ -792,15 +792,26 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpParms)
static
DWORD
MIDI_mciStop
(
UINT
wDevID
,
DWORD
dwFlags
,
LPMCI_GENERIC_PARMS
lpParms
)
{
WINE_MCIMIDI
*
wmm
=
MIDI_mciGetOpenDev
(
wDevID
);
DWORD
dwRet
=
0
;
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
wmm
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
if
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
)
{
wmm
->
dwStatus
=
MCI_MODE_STOP
;
midiOutClose
(
wmm
->
hMidi
);
int
oldstat
=
wmm
->
dwStatus
;
wmm
->
dwStatus
=
MCI_MODE_NOT_READY
;
if
(
oldstat
==
MCI_MODE_PAUSE
)
dwRet
=
midiOutReset
(
wmm
->
hMidi
);
while
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
)
Sleep
(
10
);
}
/* sanitiy reset */
wmm
->
dwStatus
=
MCI_MODE_STOP
;
TRACE
(
"wmm->dwStatus=%d
\n
"
,
wmm
->
dwStatus
);
if
(
lpParms
&&
(
dwFlags
&
MCI_NOTIFY
))
{
...
...
@@ -826,7 +837,6 @@ static DWORD MIDI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar
MIDI_mciStop
(
wDevID
,
MCI_WAIT
,
lpParms
);
}
wmm
->
dwStatus
=
MCI_MODE_STOP
;
wmm
->
nUseCount
--
;
if
(
wmm
->
nUseCount
==
0
)
{
if
(
wmm
->
hFile
!=
0
)
{
...
...
@@ -880,7 +890,8 @@ static MCI_MIDITRACK* MIDI_mciFindNextEvent(WINE_MCIMIDI* wmm, LPDWORD hiPulse)
*/
static
DWORD
MIDI_mciPlay
(
UINT
wDevID
,
DWORD
dwFlags
,
LPMCI_PLAY_PARMS
lpParms
)
{
DWORD
dwStartMS
,
dwEndMS
,
dwRet
;
DWORD
dwStartMS
,
dwEndMS
;
DWORD
dwRet
=
0
;
WORD
doPlay
,
nt
;
MCI_MIDITRACK
*
mmt
;
DWORD
hiPulse
;
...
...
@@ -946,7 +957,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
dwRet
=
midiOutOpen
(
&
wmm
->
hMidi
,
MIDIMAPPER
,
0L
,
0L
,
CALLBACK_NULL
);
/* dwRet = midiInOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);*/
while
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
)
{
while
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
&&
wmm
->
dwStatus
!=
MCI_MODE_NOT_READY
)
{
/* it seems that in case of multi-threading, gcc is optimizing just a little bit
* too much. Tell gcc not to optimize status value using volatile.
*/
...
...
@@ -1138,8 +1149,6 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
midiOutReset
(
wmm
->
hMidi
);
dwRet
=
midiOutClose
(
wmm
->
hMidi
);
wmm
->
dwStatus
=
MCI_MODE_STOP
;
/* to restart playing at beginning when it's over */
wmm
->
dwPositionMS
=
0
;
...
...
@@ -1148,7 +1157,9 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
mciDriverNotify
((
HWND
)
LOWORD
(
lpParms
->
dwCallback
),
wmm
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
return
0
;
wmm
->
dwStatus
=
MCI_MODE_STOP
;
return
dwRet
;
}
/**************************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment