Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
29001b31
Commit
29001b31
authored
Sep 22, 2000
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 22, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed reentrancy issues in play/stop operations.
parent
36706676
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
mcimidi.c
dlls/winmm/mciseq/mcimidi.c
+20
-9
No files found.
dlls/winmm/mciseq/mcimidi.c
View file @
29001b31
...
@@ -792,15 +792,26 @@ static DWORD MIDI_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_OPEN_PARMSA lpParms)
...
@@ -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
)
static
DWORD
MIDI_mciStop
(
UINT
wDevID
,
DWORD
dwFlags
,
LPMCI_GENERIC_PARMS
lpParms
)
{
{
WINE_MCIMIDI
*
wmm
=
MIDI_mciGetOpenDev
(
wDevID
);
WINE_MCIMIDI
*
wmm
=
MIDI_mciGetOpenDev
(
wDevID
);
DWORD
dwRet
=
0
;
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
TRACE
(
"(%04X, %08lX, %p);
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
if
(
wmm
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
if
(
wmm
==
NULL
)
return
MCIERR_INVALID_DEVICE_ID
;
if
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
)
{
if
(
wmm
->
dwStatus
!=
MCI_MODE_STOP
)
{
wmm
->
dwStatus
=
MCI_MODE_STOP
;
int
oldstat
=
wmm
->
dwStatus
;
midiOutClose
(
wmm
->
hMidi
);
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
);
TRACE
(
"wmm->dwStatus=%d
\n
"
,
wmm
->
dwStatus
);
if
(
lpParms
&&
(
dwFlags
&
MCI_NOTIFY
))
{
if
(
lpParms
&&
(
dwFlags
&
MCI_NOTIFY
))
{
...
@@ -826,7 +837,6 @@ static DWORD MIDI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar
...
@@ -826,7 +837,6 @@ static DWORD MIDI_mciClose(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpPar
MIDI_mciStop
(
wDevID
,
MCI_WAIT
,
lpParms
);
MIDI_mciStop
(
wDevID
,
MCI_WAIT
,
lpParms
);
}
}
wmm
->
dwStatus
=
MCI_MODE_STOP
;
wmm
->
nUseCount
--
;
wmm
->
nUseCount
--
;
if
(
wmm
->
nUseCount
==
0
)
{
if
(
wmm
->
nUseCount
==
0
)
{
if
(
wmm
->
hFile
!=
0
)
{
if
(
wmm
->
hFile
!=
0
)
{
...
@@ -880,7 +890,8 @@ static MCI_MIDITRACK* MIDI_mciFindNextEvent(WINE_MCIMIDI* wmm, LPDWORD hiPulse)
...
@@ -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
)
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
;
WORD
doPlay
,
nt
;
MCI_MIDITRACK
*
mmt
;
MCI_MIDITRACK
*
mmt
;
DWORD
hiPulse
;
DWORD
hiPulse
;
...
@@ -946,7 +957,7 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
...
@@ -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
=
midiOutOpen
(
&
wmm
->
hMidi
,
MIDIMAPPER
,
0L
,
0L
,
CALLBACK_NULL
);
/* dwRet = midiInOpen(&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
/* 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.
* 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)
...
@@ -1138,8 +1149,6 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
midiOutReset
(
wmm
->
hMidi
);
midiOutReset
(
wmm
->
hMidi
);
dwRet
=
midiOutClose
(
wmm
->
hMidi
);
dwRet
=
midiOutClose
(
wmm
->
hMidi
);
wmm
->
dwStatus
=
MCI_MODE_STOP
;
/* to restart playing at beginning when it's over */
/* to restart playing at beginning when it's over */
wmm
->
dwPositionMS
=
0
;
wmm
->
dwPositionMS
=
0
;
...
@@ -1148,7 +1157,9 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
...
@@ -1148,7 +1157,9 @@ static DWORD MIDI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
mciDriverNotify
((
HWND
)
LOWORD
(
lpParms
->
dwCallback
),
mciDriverNotify
((
HWND
)
LOWORD
(
lpParms
->
dwCallback
),
wmm
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
wmm
->
wNotifyDeviceID
,
MCI_NOTIFY_SUCCESSFUL
);
}
}
return
0
;
wmm
->
dwStatus
=
MCI_MODE_STOP
;
return
dwRet
;
}
}
/**************************************************************************
/**************************************************************************
...
...
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