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
342d59f2
Commit
342d59f2
authored
Nov 11, 2003
by
Robert Reif
Committed by
Alexandre Julliard
Nov 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a race condition where result could be read before set.
Fix test to use correct event in interactive mode.
parent
03bb9b11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
wave.c
dlls/winmm/tests/wave.c
+12
-2
audio.c
dlls/winmm/wineoss/audio.c
+2
-1
No files found.
dlls/winmm/tests/wave.c
View file @
342d59f2
...
...
@@ -371,6 +371,7 @@ static void wave_in_test_deviceIn(int device, int format, DWORD flags)
HANDLE
hevent
;
WAVEHDR
frag
;
MMRESULT
rc
;
DWORD
res
;
hevent
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
hevent
!=
NULL
,
"CreateEvent: error=%ld
\n
"
,
GetLastError
());
...
...
@@ -397,6 +398,8 @@ static void wave_in_test_deviceIn(int device, int format, DWORD flags)
CloseHandle
(
hevent
);
return
;
}
res
=
WaitForSingleObject
(
hevent
,
1000
);
ok
(
res
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed for open
\n
"
);
ok
(
wfx
.
nChannels
==
win_formats
[
format
][
3
]
&&
wfx
.
wBitsPerSample
==
win_formats
[
format
][
2
]
&&
...
...
@@ -423,16 +426,23 @@ static void wave_in_test_deviceIn(int device, int format, DWORD flags)
rc
=
waveInStart
(
win
);
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveInStart: device=%d rc=%d
\n
"
,
device
,
rc
);
WaitForSingleObject
(
hevent
,
INFINITE
);
res
=
WaitForSingleObject
(
hevent
,
1200
);
ok
(
res
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed for header
\n
"
);
ok
(
frag
.
dwFlags
&
WHDR_DONE
,
"WHDR_DONE no set in frag.dwFlags
\n
"
);
ok
(
frag
.
dwBytesRecorded
==
wfx
.
nAvgBytesPerSec
,
"frag.dwBytesRecorded=%ld, should=%ld
\n
"
,
frag
.
dwBytesRecorded
,
wfx
.
nAvgBytesPerSec
);
}
rc
=
waveInUnprepareHeader
(
win
,
&
frag
,
sizeof
(
frag
));
ok
(
rc
==
MMSYSERR_NOERROR
,
"waveInUnprepareHeader: device=%d rc=%d
\n
"
,
device
,
rc
);
waveInClose
(
win
);
res
=
WaitForSingleObject
(
hevent
,
1000
);
ok
(
res
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed for close
\n
"
);
free
(
frag
.
lpData
);
CloseHandle
(
hevent
);
waveInClose
(
win
);
}
static
void
wave_in_tests
()
...
...
dlls/winmm/wineoss/audio.c
View file @
342d59f2
...
...
@@ -2717,9 +2717,10 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
lpWaveHdr
->
dwFlags
&=
~
WHDR_INQUEUE
;
lpWaveHdr
->
dwFlags
|=
WHDR_DONE
;
wwi
->
lpQueuePtr
=
lpNext
;
widNotifyClient
(
wwi
,
WIM_DATA
,
(
DWORD
)
lpWaveHdr
,
0
);
wwi
->
lpQueuePtr
=
lpWaveHdr
=
lpNext
;
lpWaveHdr
=
lpNext
;
if
(
!
lpNext
&&
bytesRead
)
{
/* before we give up, check for more header messages */
while
(
OSS_PeekRingMessage
(
&
wwi
->
msgRing
,
&
msg
,
&
param
,
&
ev
))
...
...
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