Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c5b2acfb
Commit
c5b2acfb
authored
Sep 11, 2009
by
Jörg Höhle
Committed by
Alexandre Julliard
Sep 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Added WAVEFORMATEXTENSIBLE support, for PCM only.
parent
e6770a40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
2 deletions
+28
-2
audio.c
dlls/winecoreaudio.drv/audio.c
+28
-2
No files found.
dlls/winecoreaudio.drv/audio.c
View file @
c5b2acfb
...
...
@@ -40,8 +40,12 @@
#include "wingdi.h"
#include "winerror.h"
#include "mmddk.h"
#include "mmreg.h"
#include "dsound.h"
#include "dsdriver.h"
#include "ks.h"
#include "ksguid.h"
#include "ksmedia.h"
#include "coreaudio.h"
#include "wine/unicode.h"
#include "wine/library.h"
...
...
@@ -441,12 +445,34 @@ static BOOL supportedFormat(LPWAVEFORMATEX wf)
if
(
wf
->
wBitsPerSample
==
8
||
wf
->
wBitsPerSample
==
16
)
return
TRUE
;
}
}
else
if
(
wf
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
{
WAVEFORMATEXTENSIBLE
*
wfex
=
(
WAVEFORMATEXTENSIBLE
*
)
wf
;
if
(
wf
->
cbSize
==
22
&&
IsEqualGUID
(
&
wfex
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_PCM
))
{
if
(
wf
->
nChannels
>=
1
&&
wf
->
nChannels
<=
2
)
{
if
(
wf
->
wBitsPerSample
==
wfex
->
Samples
.
wValidBitsPerSample
)
{
if
(
wf
->
wBitsPerSample
==
8
||
wf
->
wBitsPerSample
==
16
)
return
TRUE
;
}
else
WARN
(
"wBitsPerSample != wValidBitsPerSample not supported yet
\n
"
);
}
}
else
WARN
(
"only KSDATAFORMAT_SUBTYPE_PCM supported
\n
"
);
}
else
WARN
(
"only WAVE_FORMAT_PCM supported
\n
"
);
return
FALSE
;
}
void
copyFormat
(
LPWAVEFORMATEX
wf1
,
LPPCMWAVEFORMAT
wf2
)
{
memcpy
(
wf2
,
wf1
,
sizeof
(
PCMWAVEFORMAT
));
/* Downgrade WAVE_FORMAT_EXTENSIBLE KSDATAFORMAT_SUBTYPE_PCM
* to smaller yet compatible WAVE_FORMAT_PCM structure */
if
(
wf2
->
wf
.
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
wf2
->
wf
.
wFormatTag
=
WAVE_FORMAT_PCM
;
}
/**************************************************************************
* CoreAudio_GetDevCaps [internal]
*/
...
...
@@ -915,7 +941,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwo
->
wFlags
=
HIWORD
(
dwFlags
&
CALLBACK_TYPEMASK
);
wwo
->
waveDesc
=
*
lpDesc
;
memcpy
(
&
wwo
->
format
,
lpDesc
->
lpFormat
,
sizeof
(
PCMWAVEFORMAT
)
);
copyFormat
(
lpDesc
->
lpFormat
,
&
wwo
->
format
);
wwo
->
dwPlayedTotal
=
0
;
wwo
->
dwWrittenTotal
=
0
;
...
...
@@ -1941,7 +1967,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwi
->
wFlags
=
HIWORD
(
dwFlags
&
CALLBACK_TYPEMASK
);
wwi
->
waveDesc
=
*
lpDesc
;
memcpy
(
&
wwi
->
format
,
lpDesc
->
lpFormat
,
sizeof
(
PCMWAVEFORMAT
)
);
copyFormat
(
lpDesc
->
lpFormat
,
&
wwi
->
format
);
wwi
->
dwTotalRecorded
=
0
;
...
...
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