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
a2bc634e
Commit
a2bc634e
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: Handle primary buffers in IDirectSoundBufferImpl_SetFormat.
parent
3747fb74
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
buffer.c
dlls/dsound/buffer.c
+12
-3
dsound_private.h
dlls/dsound/dsound_private.h
+1
-0
primary.c
dlls/dsound/primary.c
+4
-3
No files found.
dlls/dsound/buffer.c
View file @
a2bc634e
...
...
@@ -187,15 +187,24 @@ static inline IDirectSoundBufferImpl *impl_from_IDirectSoundBuffer8(IDirectSound
return
CONTAINING_RECORD
(
iface
,
IDirectSoundBufferImpl
,
IDirectSoundBuffer8_iface
);
}
static
inline
BOOL
is_primary_buffer
(
IDirectSoundBufferImpl
*
This
)
{
return
This
->
dsbd
.
dwFlags
&
DSBCAPS_PRIMARYBUFFER
?
TRUE
:
FALSE
;
}
static
HRESULT
WINAPI
IDirectSoundBufferImpl_SetFormat
(
IDirectSoundBuffer8
*
iface
,
LPCWAVEFORMATEX
wfex
)
{
IDirectSoundBufferImpl
*
This
=
impl_from_IDirectSoundBuffer8
(
iface
);
TRACE
(
"(%p,%p)
\n
"
,
This
,
wfex
);
/* This method is not available on secondary buffers */
WARN
(
"invalid call
\n
"
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
wfex
);
if
(
is_primary_buffer
(
This
))
return
primarybuffer_SetFormat
(
This
->
device
,
wfex
);
else
{
WARN
(
"not available for secondary buffers.
\n
"
);
return
DSERR_INVALIDCALL
;
}
}
static
HRESULT
WINAPI
IDirectSoundBufferImpl_SetVolume
(
IDirectSoundBuffer8
*
iface
,
LONG
vol
)
...
...
dlls/dsound/dsound_private.h
View file @
a2bc634e
...
...
@@ -336,6 +336,7 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave) DECLSPEC_
HRESULT
primarybuffer_create
(
DirectSoundDevice
*
device
,
IDirectSoundBufferImpl
**
ppdsb
,
const
DSBUFFERDESC
*
dsbd
)
DECLSPEC_HIDDEN
;
void
primarybuffer_destroy
(
IDirectSoundBufferImpl
*
This
)
DECLSPEC_HIDDEN
;
HRESULT
primarybuffer_SetFormat
(
DirectSoundDevice
*
device
,
LPCWAVEFORMATEX
wfex
)
DECLSPEC_HIDDEN
;
/* duplex.c */
...
...
dlls/dsound/primary.c
View file @
a2bc634e
...
...
@@ -472,12 +472,14 @@ LPWAVEFORMATEX DSOUND_CopyFormat(LPCWAVEFORMATEX wfex)
return
pwfx
;
}
static
HRESULT
DSOUND_PrimarySetFormat
(
DirectSoundDevice
*
device
,
LPCWAVEFORMATEX
wfex
,
BOOL
forced
)
HRESULT
primarybuffer_SetFormat
(
DirectSoundDevice
*
device
,
LPCWAVEFORMATEX
wfex
)
{
HRESULT
err
=
DSERR_BUFFERLOST
;
int
i
;
DWORD
nSamplesPerSec
,
bpp
,
chans
;
LPWAVEFORMATEX
oldpwfx
;
BOOL
forced
=
device
->
priolevel
==
DSSCL_WRITEPRIMARY
;
TRACE
(
"(%p,%p)
\n
"
,
device
,
wfex
);
if
(
device
->
priolevel
==
DSSCL_NORMAL
)
{
...
...
@@ -628,9 +630,8 @@ static HRESULT WINAPI PrimaryBufferImpl_SetFormat(
LPCWAVEFORMATEX
wfex
)
{
IDirectSoundBufferImpl
*
This
=
impl_from_IDirectSoundBuffer
(
iface
);
DirectSoundDevice
*
device
=
This
->
device
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
wfex
);
return
DSOUND_PrimarySetFormat
(
device
,
wfex
,
device
->
priolevel
==
DSSCL_WRITEPRIMARY
);
return
primarybuffer_SetFormat
(
This
->
device
,
wfex
);
}
static
HRESULT
WINAPI
PrimaryBufferImpl_SetVolume
(
...
...
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