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
21c45016
Commit
21c45016
authored
Oct 16, 2012
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Oct 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Fix IDirectSoundCaptureBuffer Start/Stop, with tests.
parent
6f847089
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
capture.c
dlls/dsound/capture.c
+4
-2
capture.c
dlls/dsound/tests/capture.c
+15
-9
No files found.
dlls/dsound/capture.c
View file @
21c45016
...
@@ -493,13 +493,14 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start(IDirectSoundCaptureBuf
...
@@ -493,13 +493,14 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start(IDirectSoundCaptureBuf
EnterCriticalSection
(
&
(
This
->
device
->
lock
));
EnterCriticalSection
(
&
(
This
->
device
->
lock
));
This
->
flags
=
dwFlags
;
TRACE
(
"old This->device->state=%s
\n
"
,
captureStateString
[
This
->
device
->
state
]);
if
(
This
->
device
->
state
==
STATE_STOPPED
)
if
(
This
->
device
->
state
==
STATE_STOPPED
)
This
->
device
->
state
=
STATE_STARTING
;
This
->
device
->
state
=
STATE_STARTING
;
else
if
(
This
->
device
->
state
==
STATE_STOPPING
)
else
if
(
This
->
device
->
state
==
STATE_STOPPING
)
This
->
device
->
state
=
STATE_CAPTURING
;
This
->
device
->
state
=
STATE_CAPTURING
;
else
goto
out
;
TRACE
(
"new This->device->state=%s
\n
"
,
captureStateString
[
This
->
device
->
state
]);
TRACE
(
"new This->device->state=%s
\n
"
,
captureStateString
[
This
->
device
->
state
]);
This
->
flags
=
dwFlags
;
if
(
This
->
device
->
buffer
)
if
(
This
->
device
->
buffer
)
FillMemory
(
This
->
device
->
buffer
,
This
->
device
->
buflen
,
(
This
->
device
->
pwfx
->
wBitsPerSample
==
8
)
?
128
:
0
);
FillMemory
(
This
->
device
->
buffer
,
This
->
device
->
buflen
,
(
This
->
device
->
pwfx
->
wBitsPerSample
==
8
)
?
128
:
0
);
...
@@ -511,6 +512,7 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start(IDirectSoundCaptureBuf
...
@@ -511,6 +512,7 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_Start(IDirectSoundCaptureBuf
return
hres
;
return
hres
;
}
}
out:
LeaveCriticalSection
(
&
This
->
device
->
lock
);
LeaveCriticalSection
(
&
This
->
device
->
lock
);
TRACE
(
"returning DS_OK
\n
"
);
TRACE
(
"returning DS_OK
\n
"
);
...
...
dlls/dsound/tests/capture.c
View file @
21c45016
...
@@ -394,15 +394,18 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
...
@@ -394,15 +394,18 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
ok
(
ref
==
0
,
"IDirectSoundNotify_Release(): has %d references, should have "
ok
(
ref
==
0
,
"IDirectSoundNotify_Release(): has %d references, should have "
"0
\n
"
,
ref
);
"0
\n
"
,
ref
);
if
(
record
)
{
rc
=
IDirectSoundCaptureBuffer_Start
(
dscbo
,
DSCBSTART_LOOPING
);
rc
=
IDirectSoundCaptureBuffer_Start
(
dscbo
,
DSCBSTART_LOOPING
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Start() failed: %08x
\n
"
,
rc
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Start() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundCaptureBuffer_Start
(
dscbo
,
0
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Start() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundCaptureBuffer_GetStatus
(
dscbo
,
&
status
);
rc
=
IDirectSoundCaptureBuffer_GetStatus
(
dscbo
,
&
status
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetStatus() failed: %08x
\n
"
,
rc
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_GetStatus() failed: %08x
\n
"
,
rc
);
ok
(
status
==
(
DSCBSTATUS_CAPTURING
|
DSCBSTATUS_LOOPING
),
ok
(
status
==
(
DSCBSTATUS_CAPTURING
|
DSCBSTATUS_LOOPING
),
"GetStatus: bad status: %x
\n
"
,
status
);
"GetStatus: bad status: %x
\n
"
,
status
);
if
(
record
)
{
/* wait for the notifications */
/* wait for the notifications */
for
(
i
=
0
;
i
<
(
NOTIFICATIONS
*
2
);
i
++
)
{
for
(
i
=
0
;
i
<
(
NOTIFICATIONS
*
2
);
i
++
)
{
rc
=
WaitForMultipleObjects
(
NOTIFICATIONS
,
state
.
event
,
FALSE
,
3000
);
rc
=
WaitForMultipleObjects
(
NOTIFICATIONS
,
state
.
event
,
FALSE
,
3000
);
...
@@ -417,9 +420,12 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
...
@@ -417,9 +420,12 @@ static void test_capture_buffer(LPDIRECTSOUNDCAPTURE dsco,
break
;
break
;
}
}
rc
=
IDirectSoundCaptureBuffer_Stop
(
dscbo
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Stop() failed: %08x
\n
"
,
rc
);
}
}
rc
=
IDirectSoundCaptureBuffer_Stop
(
dscbo
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Stop() failed: %08x
\n
"
,
rc
);
rc
=
IDirectSoundCaptureBuffer_Stop
(
dscbo
);
ok
(
rc
==
DS_OK
,
"IDirectSoundCaptureBuffer_Stop() failed: %08x
\n
"
,
rc
);
}
}
static
BOOL
WINAPI
dscenum_callback
(
LPGUID
lpGuid
,
LPCSTR
lpcstrDescription
,
static
BOOL
WINAPI
dscenum_callback
(
LPGUID
lpGuid
,
LPCSTR
lpcstrDescription
,
...
...
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