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
3dac0e5a
Commit
3dac0e5a
authored
Jan 12, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Add an extra refcount for the capture buffer object.
parent
e8f7ddf7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
29 deletions
+40
-29
capture.c
dlls/dsound/capture.c
+39
-29
dsound_private.h
dlls/dsound/dsound_private.h
+1
-0
No files found.
dlls/dsound/capture.c
View file @
3dac0e5a
...
...
@@ -44,6 +44,34 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dsound
);
static
void
capturebuffer_destroy
(
IDirectSoundCaptureBufferImpl
*
This
)
{
if
(
This
->
device
->
state
==
STATE_CAPTURING
)
This
->
device
->
state
=
STATE_STOPPING
;
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
if
(
This
->
device
->
client
)
{
IAudioClient_Release
(
This
->
device
->
client
);
This
->
device
->
client
=
NULL
;
}
if
(
This
->
device
->
capture
)
{
IAudioCaptureClient_Release
(
This
->
device
->
capture
);
This
->
device
->
capture
=
NULL
;
}
/* remove from DirectSoundCaptureDevice */
This
->
device
->
capture_buffer
=
NULL
;
if
(
This
->
notify
)
IDirectSoundNotify_Release
((
LPDIRECTSOUNDNOTIFY
)
This
->
notify
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
notifies
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
/*****************************************************************************
* IDirectSoundCaptureNotify implementation structure
*/
...
...
@@ -228,46 +256,26 @@ static HRESULT WINAPI IDirectSoundCaptureBufferImpl_QueryInterface(IDirectSoundC
static
ULONG
WINAPI
IDirectSoundCaptureBufferImpl_AddRef
(
IDirectSoundCaptureBuffer8
*
iface
)
{
IDirectSoundCaptureBufferImpl
*
This
=
impl_from_IDirectSoundCaptureBuffer8
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
)
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
if
(
ref
==
1
)
InterlockedIncrement
(
&
This
->
numIfaces
);
return
ref
;
}
static
ULONG
WINAPI
IDirectSoundCaptureBufferImpl_Release
(
IDirectSoundCaptureBuffer8
*
iface
)
{
IDirectSoundCaptureBufferImpl
*
This
=
impl_from_IDirectSoundCaptureBuffer8
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
)
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
)
{
TRACE
(
"deleting object
\n
"
);
if
(
This
->
device
->
state
==
STATE_CAPTURING
)
This
->
device
->
state
=
STATE_STOPPING
;
HeapFree
(
GetProcessHeap
(),
0
,
This
->
pdscbd
);
if
(
This
->
device
->
client
)
{
IAudioClient_Release
(
This
->
device
->
client
);
This
->
device
->
client
=
NULL
;
}
if
(
This
->
device
->
capture
)
{
IAudioCaptureClient_Release
(
This
->
device
->
capture
);
This
->
device
->
capture
=
NULL
;
}
/* remove from DirectSoundCaptureDevice */
This
->
device
->
capture_buffer
=
NULL
;
if
(
This
->
notify
)
IDirectSoundNotify_Release
((
LPDIRECTSOUNDNOTIFY
)
This
->
notify
);
if
(
!
ref
&&
!
InterlockedDecrement
(
&
This
->
numIfaces
))
capturebuffer_destroy
(
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
notifies
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
}
...
...
@@ -697,7 +705,8 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
LPBYTE
newbuf
;
DWORD
buflen
;
This
->
ref
=
1
;
This
->
numIfaces
=
0
;
This
->
ref
=
0
;
This
->
device
=
device
;
This
->
device
->
capture_buffer
=
This
;
This
->
notify
=
NULL
;
...
...
@@ -771,6 +780,7 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create(
device
->
buflen
=
buflen
;
}
IDirectSoundCaptureBuffer_AddRef
(
&
This
->
IDirectSoundCaptureBuffer8_iface
);
*
ppobj
=
This
;
TRACE
(
"returning DS_OK
\n
"
);
...
...
dlls/dsound/dsound_private.h
View file @
3dac0e5a
...
...
@@ -248,6 +248,7 @@ struct DirectSoundCaptureDevice
struct
IDirectSoundCaptureBufferImpl
{
IDirectSoundCaptureBuffer8
IDirectSoundCaptureBuffer8_iface
;
LONG
numIfaces
;
/* "in use interfaces" refcount */
LONG
ref
;
/* IDirectSoundCaptureBuffer fields */
DirectSoundCaptureDevice
*
device
;
...
...
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