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
2a117a20
Commit
2a117a20
authored
Nov 05, 2007
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Nov 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Add support for WAVEFORMATEXTENSIBLE format.
parent
15eb4c6f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
1 deletion
+49
-1
buffer.c
dlls/dsound/buffer.c
+2
-1
dsound.c
dlls/dsound/dsound.c
+44
-0
dsound_main.c
dlls/dsound/dsound_main.c
+3
-0
No files found.
dlls/dsound/buffer.c
View file @
2a117a20
...
...
@@ -495,8 +495,9 @@ static HRESULT WINAPI IDirectSoundBufferImpl_GetFormat(
*
wfwritten
=
size
;
}
else
{
WARN
(
"invalid parameter: wfsize too small
\n
"
);
CopyMemory
(
lpwf
,
This
->
pwfx
,
wfsize
);
if
(
wfwritten
)
*
wfwritten
=
0
;
*
wfwritten
=
wfsize
;
return
DSERR_INVALIDPARAM
;
}
}
else
{
...
...
dlls/dsound/dsound.c
View file @
2a117a20
...
...
@@ -31,6 +31,10 @@
#include "mmsystem.h"
#include "winternl.h"
#include "mmddk.h"
#include "wingdi.h"
#include "mmreg.h"
#include "ks.h"
#include "ksmedia.h"
#include "wine/debug.h"
#include "dsound.h"
#include "dsdriver.h"
...
...
@@ -1522,6 +1526,7 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
WARN
(
"invalid parameter: ppdsb == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
*
ppdsb
=
NULL
;
if
(
TRACE_ON
(
dsound
))
{
TRACE
(
"(structsize=%d)
\n
"
,
dsbd
->
dwSize
);
...
...
@@ -1558,12 +1563,51 @@ HRESULT DirectSoundDevice_CreateSoundBuffer(
}
}
else
{
IDirectSoundBufferImpl
*
dsb
;
WAVEFORMATEXTENSIBLE
*
pwfxe
;
if
(
dsbd
->
lpwfxFormat
==
NULL
)
{
WARN
(
"invalid parameter: dsbd->lpwfxFormat can't be NULL for "
"secondary buffer
\n
"
);
return
DSERR_INVALIDPARAM
;
}
pwfxe
=
(
WAVEFORMATEXTENSIBLE
*
)
dsbd
->
lpwfxFormat
;
if
(
pwfxe
->
Format
.
wBitsPerSample
!=
16
&&
pwfxe
->
Format
.
wBitsPerSample
!=
8
&&
pwfxe
->
Format
.
wFormatTag
!=
WAVE_FORMAT_EXTENSIBLE
)
{
WARN
(
"wBitsPerSample=%d needs a WAVEFORMATEXTENSIBLE
\n
"
,
dsbd
->
lpwfxFormat
->
wBitsPerSample
);
return
DSERR_CONTROLUNAVAIL
;
}
if
(
pwfxe
->
Format
.
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
{
if
(
pwfxe
->
Format
.
cbSize
<
(
sizeof
(
WAVEFORMATEXTENSIBLE
)
-
sizeof
(
WAVEFORMATEX
)))
{
WARN
(
"Too small a cbSize (%d/%d)
\n
"
,
pwfxe
->
Format
.
cbSize
,
(
sizeof
(
WAVEFORMATEXTENSIBLE
)
-
sizeof
(
WAVEFORMATEX
)));
return
DSERR_INVALIDPARAM
;
}
if
(
pwfxe
->
Format
.
cbSize
>
(
sizeof
(
WAVEFORMATEXTENSIBLE
)
-
sizeof
(
WAVEFORMATEX
)))
{
WARN
(
"Too big a cbSize (%d/%d)
\n
"
,
pwfxe
->
Format
.
cbSize
,
(
sizeof
(
WAVEFORMATEXTENSIBLE
)
-
sizeof
(
WAVEFORMATEX
)));
return
DSERR_CONTROLUNAVAIL
;
}
if
(
!
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
))
{
if
(
!
IsEqualGUID
(
&
pwfxe
->
SubFormat
,
&
GUID_NULL
))
FIXME
(
"SubFormat %s not supported right now.
\n
"
,
debugstr_guid
(
&
pwfxe
->
SubFormat
));
return
DSERR_INVALIDPARAM
;
}
if
(
pwfxe
->
Samples
.
wValidBitsPerSample
>
dsbd
->
lpwfxFormat
->
wBitsPerSample
)
{
WARN
(
"Samples.wValidBitsPerSample(%d) > Format.wBitsPerSample (%d)
\n
"
,
pwfxe
->
Samples
.
wValidBitsPerSample
,
pwfxe
->
Format
.
wBitsPerSample
);
return
DSERR_INVALIDPARAM
;
}
if
(
pwfxe
->
Samples
.
wValidBitsPerSample
&&
pwfxe
->
Samples
.
wValidBitsPerSample
<
dsbd
->
lpwfxFormat
->
wBitsPerSample
)
{
FIXME
(
"Non-packed formats not supported right now: %d/%d
\n
"
,
pwfxe
->
Samples
.
wValidBitsPerSample
,
dsbd
->
lpwfxFormat
->
wBitsPerSample
);
return
DSERR_CONTROLUNAVAIL
;
}
}
TRACE
(
"(formattag=0x%04x,chans=%d,samplerate=%d,"
"bytespersec=%d,blockalign=%d,bitspersamp=%d,cbSize=%d)
\n
"
,
...
...
dlls/dsound/dsound_main.c
View file @
2a117a20
...
...
@@ -48,8 +48,11 @@
#include "wine/debug.h"
#include "dsound.h"
#include "dsconf.h"
#include "ks.h"
#include "initguid.h"
#include "ksmedia.h"
#include "dsdriver.h"
#include "dsound_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
dsound
);
...
...
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