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
89fe38ca
Commit
89fe38ca
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: Make supported format test more restrictive.
parent
8870fe38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
24 deletions
+18
-24
audio.c
dlls/winecoreaudio.drv/audio.c
+18
-24
No files found.
dlls/winecoreaudio.drv/audio.c
View file @
89fe38ca
...
...
@@ -431,6 +431,22 @@ static DWORD bytes_to_mmtime(LPMMTIME lpTime, DWORD position,
return
MMSYSERR_NOERROR
;
}
static
BOOL
supportedFormat
(
LPWAVEFORMATEX
wf
)
{
if
(
wf
->
nSamplesPerSec
==
0
)
return
FALSE
;
if
(
wf
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
if
(
wf
->
nChannels
>=
1
&&
wf
->
nChannels
<=
2
)
{
if
(
wf
->
wBitsPerSample
==
8
||
wf
->
wBitsPerSample
==
16
)
return
TRUE
;
}
}
else
WARN
(
"only WAVE_FORMAT_PCM supported
\n
"
);
return
FALSE
;
}
/**************************************************************************
* CoreAudio_GetDevCaps [internal]
*/
...
...
@@ -793,10 +809,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
lpDesc
->
lpFormat
->
wFormatTag
,
lpDesc
->
lpFormat
->
nChannels
,
lpDesc
->
lpFormat
->
nSamplesPerSec
,
lpDesc
->
lpFormat
->
wBitsPerSample
);
if
(
lpDesc
->
lpFormat
->
wFormatTag
!=
WAVE_FORMAT_PCM
||
lpDesc
->
lpFormat
->
nChannels
==
0
||
lpDesc
->
lpFormat
->
nSamplesPerSec
==
0
)
if
(
!
supportedFormat
(
lpDesc
->
lpFormat
))
{
WARN
(
"Bad format: tag=%04X nChannels=%d nSamplesPerSec=%d wBitsPerSample=%d !
\n
"
,
lpDesc
->
lpFormat
->
wFormatTag
,
lpDesc
->
lpFormat
->
nChannels
,
...
...
@@ -893,14 +906,6 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwo
->
waveDesc
=
*
lpDesc
;
memcpy
(
&
wwo
->
format
,
lpDesc
->
lpFormat
,
sizeof
(
PCMWAVEFORMAT
));
if
(
wwo
->
format
.
wBitsPerSample
==
0
)
{
WARN
(
"Resetting zeroed wBitsPerSample
\n
"
);
wwo
->
format
.
wBitsPerSample
=
8
*
(
wwo
->
format
.
wf
.
nAvgBytesPerSec
/
wwo
->
format
.
wf
.
nSamplesPerSec
)
/
wwo
->
format
.
wf
.
nChannels
;
}
wwo
->
dwPlayedTotal
=
0
;
wwo
->
dwWrittenTotal
=
0
;
...
...
@@ -1884,9 +1889,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
lpDesc
->
lpFormat
->
wFormatTag
,
lpDesc
->
lpFormat
->
nChannels
,
lpDesc
->
lpFormat
->
nSamplesPerSec
,
lpDesc
->
lpFormat
->
wBitsPerSample
);
if
(
lpDesc
->
lpFormat
->
wFormatTag
!=
WAVE_FORMAT_PCM
||
lpDesc
->
lpFormat
->
nChannels
==
0
||
lpDesc
->
lpFormat
->
nSamplesPerSec
==
0
||
if
(
!
supportedFormat
(
lpDesc
->
lpFormat
)
||
lpDesc
->
lpFormat
->
nSamplesPerSec
!=
AudioUnit_GetInputDeviceSampleRate
()
)
{
...
...
@@ -1920,15 +1923,6 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwi
->
waveDesc
=
*
lpDesc
;
memcpy
(
&
wwi
->
format
,
lpDesc
->
lpFormat
,
sizeof
(
PCMWAVEFORMAT
));
if
(
wwi
->
format
.
wBitsPerSample
==
0
)
{
WARN
(
"Resetting zeroed wBitsPerSample
\n
"
);
wwi
->
format
.
wBitsPerSample
=
8
*
(
wwi
->
format
.
wf
.
nAvgBytesPerSec
/
wwi
->
format
.
wf
.
nSamplesPerSec
)
/
wwi
->
format
.
wf
.
nChannels
;
}
wwi
->
dwTotalRecorded
=
0
;
wwi
->
trace_on
=
TRACE_ON
(
wave
);
...
...
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