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
Lorenzo Ferrillo
wine
Commits
3dac0e5a
Commit
3dac0e5a
authored
13 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dsound: Add an extra refcount for the capture buffer object.
parent
e8f7ddf7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/dsound/capture.c
+39
-29
39 additions, 29 deletions
dlls/dsound/capture.c
dlls/dsound/dsound_private.h
+1
-0
1 addition, 0 deletions
dlls/dsound/dsound_private.h
with
40 additions
and
29 deletions
dlls/dsound/capture.c
+
39
−
29
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
"
);
...
...
This diff is collapsed.
Click to expand it.
dlls/dsound/dsound_private.h
+
1
−
0
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
;
...
...
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