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
c0565143
Commit
c0565143
authored
Aug 31, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 31, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Don't delete the primary buffer if a sub iface is still in use.
parent
ffb51208
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
17 deletions
+27
-17
dsound.c
dlls/dsound/dsound.c
+3
-4
dsound_private.h
dlls/dsound/dsound_private.h
+1
-0
primary.c
dlls/dsound/primary.c
+13
-6
sound3d.c
dlls/dsound/sound3d.c
+10
-7
No files found.
dlls/dsound/dsound.c
View file @
c0565143
...
@@ -1558,10 +1558,9 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
...
@@ -1558,10 +1558,9 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
device
->
dsbd
.
dwFlags
|=
DSBCAPS_LOCHARDWARE
;
device
->
dsbd
.
dwFlags
|=
DSBCAPS_LOCHARDWARE
;
else
device
->
dsbd
.
dwFlags
|=
DSBCAPS_LOCSOFTWARE
;
else
device
->
dsbd
.
dwFlags
|=
DSBCAPS_LOCSOFTWARE
;
hres
=
primarybuffer_create
(
device
,
&
(
device
->
primary
),
&
(
device
->
dsbd
));
hres
=
primarybuffer_create
(
device
,
&
(
device
->
primary
),
&
(
device
->
dsbd
));
if
(
device
->
primary
)
{
if
(
device
->
primary
)
IDirectSoundBuffer_AddRef
((
LPDIRECTSOUNDBUFFER8
)(
device
->
primary
));
*
ppdsb
=
(
IDirectSoundBuffer
*
)
&
device
->
primary
->
IDirectSoundBuffer8_iface
;
*
ppdsb
=
(
LPDIRECTSOUNDBUFFER
)(
device
->
primary
);
else
}
else
WARN
(
"primarybuffer_create() failed
\n
"
);
WARN
(
"primarybuffer_create() failed
\n
"
);
}
}
}
else
{
}
else
{
...
...
dlls/dsound/dsound_private.h
View file @
c0565143
...
@@ -336,6 +336,7 @@ LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex) DECLSPEC_HIDDEN;
...
@@ -336,6 +336,7 @@ LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex) DECLSPEC_HIDDEN;
HRESULT
DSOUND_ReopenDevice
(
DirectSoundDevice
*
device
,
BOOL
forcewave
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_ReopenDevice
(
DirectSoundDevice
*
device
,
BOOL
forcewave
)
DECLSPEC_HIDDEN
;
HRESULT
primarybuffer_create
(
DirectSoundDevice
*
device
,
IDirectSoundBufferImpl
**
ppdsb
,
HRESULT
primarybuffer_create
(
DirectSoundDevice
*
device
,
IDirectSoundBufferImpl
**
ppdsb
,
const
DSBUFFERDESC
*
dsbd
)
DECLSPEC_HIDDEN
;
const
DSBUFFERDESC
*
dsbd
)
DECLSPEC_HIDDEN
;
void
primarybuffer_destroy
(
IDirectSoundBufferImpl
*
This
)
DECLSPEC_HIDDEN
;
/* duplex.c */
/* duplex.c */
...
...
dlls/dsound/primary.c
View file @
c0565143
...
@@ -769,20 +769,26 @@ static ULONG WINAPI PrimaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER iface)
...
@@ -769,20 +769,26 @@ static ULONG WINAPI PrimaryBufferImpl_AddRef(LPDIRECTSOUNDBUFFER iface)
IDirectSoundBufferImpl
*
This
=
impl_from_IDirectSoundBuffer
(
iface
);
IDirectSoundBufferImpl
*
This
=
impl_from_IDirectSoundBuffer
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
if
(
ref
==
1
)
InterlockedIncrement
(
&
This
->
numIfaces
);
return
ref
;
return
ref
;
}
}
void
primarybuffer_destroy
(
IDirectSoundBufferImpl
*
This
)
{
This
->
device
->
primary
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
static
ULONG
WINAPI
PrimaryBufferImpl_Release
(
LPDIRECTSOUNDBUFFER
iface
)
static
ULONG
WINAPI
PrimaryBufferImpl_Release
(
LPDIRECTSOUNDBUFFER
iface
)
{
{
IDirectSoundBufferImpl
*
This
=
impl_from_IDirectSoundBuffer
(
iface
);
IDirectSoundBufferImpl
*
This
=
impl_from_IDirectSoundBuffer
(
iface
);
DWORD
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
DWORD
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
+
1
);
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
)
{
if
(
!
ref
&&
!
InterlockedDecrement
(
&
This
->
numIfaces
))
This
->
device
->
primary
=
NULL
;
primarybuffer_destroy
(
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
return
ref
;
return
ref
;
}
}
...
@@ -1248,7 +1254,8 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl *
...
@@ -1248,7 +1254,8 @@ HRESULT primarybuffer_create(DirectSoundDevice *device, IDirectSoundBufferImpl *
return
DSERR_OUTOFMEMORY
;
return
DSERR_OUTOFMEMORY
;
}
}
dsb
->
ref
=
0
;
dsb
->
ref
=
1
;
dsb
->
numIfaces
=
1
;
dsb
->
device
=
device
;
dsb
->
device
=
device
;
dsb
->
IDirectSoundBuffer8_iface
.
lpVtbl
=
(
IDirectSoundBuffer8Vtbl
*
)
&
dspbvt
;
dsb
->
IDirectSoundBuffer8_iface
.
lpVtbl
=
(
IDirectSoundBuffer8Vtbl
*
)
&
dspbvt
;
...
...
dlls/dsound/sound3d.c
View file @
c0565143
...
@@ -757,13 +757,9 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_QueryInterface(
...
@@ -757,13 +757,9 @@ static HRESULT WINAPI IDirectSound3DListenerImpl_QueryInterface(
}
}
if
(
IsEqualGUID
(
riid
,
&
IID_IDirectSoundBuffer
)
)
{
if
(
IsEqualGUID
(
riid
,
&
IID_IDirectSoundBuffer
)
)
{
if
(
!
This
->
device
->
primary
)
*
ppobj
=
&
This
->
device
->
primary
->
IDirectSoundBuffer8_iface
;
primarybuffer_create
(
This
->
device
,
&
This
->
device
->
primary
,
&
This
->
device
->
dsbd
);
IDirectSoundBuffer8_AddRef
(
&
This
->
device
->
primary
->
IDirectSoundBuffer8_iface
);
if
(
This
->
device
->
primary
)
{
return
S_OK
;
*
ppobj
=
This
->
device
->
primary
;
IDirectSoundBuffer_AddRef
((
LPDIRECTSOUNDBUFFER
)
*
ppobj
);
return
S_OK
;
}
}
}
FIXME
(
"Unknown IID %s
\n
"
,
debugstr_guid
(
riid
)
);
FIXME
(
"Unknown IID %s
\n
"
,
debugstr_guid
(
riid
)
);
...
@@ -774,7 +770,12 @@ static ULONG WINAPI IDirectSound3DListenerImpl_AddRef(LPDIRECTSOUND3DLISTENER if
...
@@ -774,7 +770,12 @@ static ULONG WINAPI IDirectSound3DListenerImpl_AddRef(LPDIRECTSOUND3DLISTENER if
{
{
IDirectSound3DListenerImpl
*
This
=
(
IDirectSound3DListenerImpl
*
)
iface
;
IDirectSound3DListenerImpl
*
This
=
(
IDirectSound3DListenerImpl
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
if
(
ref
==
1
)
InterlockedIncrement
(
&
This
->
device
->
primary
->
numIfaces
);
return
ref
;
return
ref
;
}
}
...
@@ -787,6 +788,8 @@ static ULONG WINAPI IDirectSound3DListenerImpl_Release(LPDIRECTSOUND3DLISTENER i
...
@@ -787,6 +788,8 @@ static ULONG WINAPI IDirectSound3DListenerImpl_Release(LPDIRECTSOUND3DLISTENER i
if
(
!
ref
)
{
if
(
!
ref
)
{
This
->
device
->
listener
=
0
;
This
->
device
->
listener
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
InterlockedDecrement
(
&
This
->
device
->
primary
->
numIfaces
))
primarybuffer_destroy
(
This
->
device
->
primary
);
TRACE
(
"(%p) released
\n
"
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
}
return
ref
;
return
ref
;
...
...
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