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
ce806478
Commit
ce806478
authored
Jan 09, 2000
by
Bradley Baetz
Committed by
Alexandre Julliard
Jan 09, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed race condition between app and wine in WAVE_mciPlay.
parent
ae6de763
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
mciwave.c
dlls/winmm/mciwave/mciwave.c
+15
-9
No files found.
dlls/winmm/mciwave/mciwave.c
View file @
ce806478
...
@@ -28,7 +28,7 @@ typedef struct {
...
@@ -28,7 +28,7 @@ typedef struct {
MCI_WAVE_OPEN_PARMSA
openParms
;
MCI_WAVE_OPEN_PARMSA
openParms
;
LPWAVEFORMATEX
lpWaveFormat
;
LPWAVEFORMATEX
lpWaveFormat
;
BOOL
fInput
;
/* FALSE = Output, TRUE = Input */
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
dwMciTimeFormat
;
/* One of the supported MCI_FORMAT_xxxx */
DWORD
dwFileOffset
;
/* Offset of chunk in mmio file */
DWORD
dwFileOffset
;
/* Offset of chunk in mmio file */
DWORD
dwLength
;
/* number of bytes in chunk for playing */
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
...
@@ -432,7 +432,7 @@ static DWORD WAVE_mciStop(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParm
if
(
oldStat
==
MCI_MODE_PAUSE
)
if
(
oldStat
==
MCI_MODE_PAUSE
)
dwRet
=
(
wmw
->
fInput
)
?
waveInReset
(
wmw
->
hWave
)
:
waveOutReset
(
wmw
->
hWave
);
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
);
Sleep
(
10
);
break
;
break
;
}
}
...
@@ -550,19 +550,26 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
...
@@ -550,19 +550,26 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
return
MCIERR_FILE_NOT_FOUND
;
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
)
{
if
(
wmw
->
dwStatus
==
MCI_MODE_PAUSE
)
{
/* FIXME: parameters (start/end) in lpParams may not be used */
/* FIXME: parameters (start/end) in lpParams may not be used */
return
WAVE_mciResume
(
wDevID
,
dwFlags
,
(
LPMCI_GENERIC_PARMS
)
lpParms
);
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
;
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
;
end
=
0xFFFFFFFF
;
if
(
lpParms
&&
(
dwFlags
&
MCI_FROM
))
{
if
(
lpParms
&&
(
dwFlags
&
MCI_FROM
))
{
wmw
->
dwPosition
=
WAVE_ConvertTimeFormatToByte
(
wmw
,
lpParms
->
dwFrom
);
wmw
->
dwPosition
=
WAVE_ConvertTimeFormatToByte
(
wmw
,
lpParms
->
dwFrom
);
...
@@ -625,7 +632,6 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
...
@@ -625,7 +632,6 @@ static DWORD WAVE_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
wmw
->
dwEventCount
=
1L
;
/* for first buffer */
wmw
->
dwEventCount
=
1L
;
/* for first buffer */
TRACE
(
"Playing (normalized) from byte=%lu for %lu bytes
\n
"
,
wmw
->
dwPosition
,
left
);
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 */
/* FIXME: this doesn't work if wmw->dwPosition != 0 */
while
(
left
>
0
&&
wmw
->
dwStatus
!=
MCI_MODE_STOP
&&
wmw
->
dwStatus
!=
MCI_MODE_NOT_READY
)
{
while
(
left
>
0
&&
wmw
->
dwStatus
!=
MCI_MODE_STOP
&&
wmw
->
dwStatus
!=
MCI_MODE_NOT_READY
)
{
...
...
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