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
Alexey Alyaev
wine
Commits
ce806478
Commit
ce806478
authored
25 years ago
by
Bradley Baetz
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed race condition between app and wine in WAVE_mciPlay.
parent
ae6de763
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/winmm/mciwave/mciwave.c
+15
-9
15 additions, 9 deletions
dlls/winmm/mciwave/mciwave.c
with
15 additions
and
9 deletions
dlls/winmm/mciwave/mciwave.c
+
15
−
9
View file @
ce806478
...
...
@@ -28,7 +28,7 @@ typedef struct {
MCI_WAVE_OPEN_PARMSA
openParms
;
LPWAVEFORMATEX
lpWaveFormat
;
BOOL
fInput
;
/* FALSE = Output, TRUE = Input */
WORD
dwStatus
;
/* one from MCI_MODE_xxxx */
volatile
WORD
dwStatus
;
/* one from MCI_MODE_xxxx */
DWORD
dwMciTimeFormat
;
/* One of the supported MCI_FORMAT_xxxx */
DWORD
dwFileOffset
;
/* Offset of chunk in mmio file */
DWORD
dwLength
;
/* number of bytes in chunk for playing */
...
...
@@ -432,7 +432,7 @@ static DWORD WAVE_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm
if
(
oldStat
==
MCI_MODE_PAUSE
)
dwRet
=
(
wmw
->
fInput
)
?
waveInReset
(
wmw
->
hWave
)
:
waveOutReset
(
wmw
->
hWave
);
}
while
(
((
volatile
WINE_MCIWAVE
*
)
wmw
)
->
dwStatus
!=
MCI_MODE_STOP
)
while
(
wmw
->
dwStatus
!=
MCI_MODE_STOP
)
Sleep
(
10
);
break
;
}
...
...
@@ -550,19 +550,26 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
return
MCIERR_FILE_NOT_FOUND
;
}
if
(
!
(
dwFlags
&
MCI_WAIT
))
{
return
MCI_SendCommandAsync
(
wmw
->
wNotifyDeviceID
,
MCI_PLAY
,
dwFlags
,
(
DWORD
)
lpParms
,
sizeof
(
MCI_PLAY_PARMS
));
}
if
(
wmw
->
dwStatus
!=
MCI_MODE_STOP
)
{
if
(
wmw
->
dwStatus
==
MCI_MODE_PAUSE
)
{
/* FIXME: parameters (start/end) in lpParams may not be used */
return
WAVE_mciResume
(
wDevID
,
dwFlags
,
(
LPMCI_GENERIC_PARMS
)
lpParms
);
}
/** This function will be called again by a thread when async is used.
* We have to set MCI_MODE_PLAY before we do this so that the app can spin
* on MCI_STATUS, so we have to allow it here if we're not going to start this thread.
*/
if
((
wmw
->
dwStatus
!=
MCI_MODE_STOP
)
&&
((
wmw
->
dwStatus
!=
MCI_MODE_PLAY
)
&&
(
dwFlags
&
MCI_WAIT
)))
{
return
MCIERR_INTERNAL
;
}
wmw
->
dwStatus
=
MCI_MODE_PLAY
;
if
(
!
(
dwFlags
&
MCI_WAIT
))
{
return
MCI_SendCommandAsync
(
wmw
->
wNotifyDeviceID
,
MCI_PLAY
,
dwFlags
,
(
DWORD
)
lpParms
,
sizeof
(
MCI_PLAY_PARMS
));
}
end
=
0xFFFFFFFF
;
if
(
lpParms
&&
(
dwFlags
&
MCI_FROM
))
{
wmw
->
dwPosition
=
WAVE_ConvertTimeFormatToByte
(
wmw
,
lpParms
->
dwFrom
);
...
...
@@ -625,7 +632,6 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
wmw
->
dwEventCount
=
1L
;
/* for first buffer */
TRACE
(
"Playing (normalized) from byte=%lu for %lu bytes
\n
"
,
wmw
->
dwPosition
,
left
);
wmw
->
dwStatus
=
MCI_MODE_PLAY
;
/* FIXME: this doesn't work if wmw->dwPosition != 0 */
while
(
left
>
0
&&
wmw
->
dwStatus
!=
MCI_MODE_STOP
&&
wmw
->
dwStatus
!=
MCI_MODE_NOT_READY
)
{
...
...
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