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
1d1aa7e8
Commit
1d1aa7e8
authored
Dec 03, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
Dec 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winealsa.drv: Improve IsFormatSupported handling.
parent
d906c943
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
mmdevdrv.c
dlls/winealsa.drv/mmdevdrv.c
+30
-0
No files found.
dlls/winealsa.drv/mmdevdrv.c
View file @
1d1aa7e8
...
...
@@ -1230,6 +1230,12 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface,
if
(
duration
<
3
*
period
)
duration
=
3
*
period
;
}
else
{
if
(
fmt
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
){
if
(((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
dwChannelMask
==
0
||
((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
dwChannelMask
&
SPEAKER_RESERVED
)
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
}
if
(
!
period
)
period
=
DefaultPeriod
;
/* not minimum */
if
(
period
<
MinimumPeriod
||
period
>
5000000
)
...
...
@@ -1587,6 +1593,15 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
out
=
NULL
;
}
if
(
fmt
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
&&
(
fmt
->
nAvgBytesPerSec
==
0
||
fmt
->
nBlockAlign
==
0
||
((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
Samples
.
wValidBitsPerSample
>
fmt
->
wBitsPerSample
))
return
E_INVALIDARG
;
if
(
fmt
->
nChannels
==
0
)
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
EnterCriticalSection
(
&
This
->
lock
);
if
((
err
=
snd_pcm_hw_params_any
(
This
->
pcm_handle
,
This
->
hw_params
))
<
0
){
...
...
@@ -1664,6 +1679,19 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
if
(
closest
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
((
WAVEFORMATEXTENSIBLE
*
)
closest
)
->
dwChannelMask
=
get_channel_mask
(
closest
->
nChannels
);
if
(
fmt
->
nBlockAlign
!=
fmt
->
nChannels
*
fmt
->
wBitsPerSample
/
8
||
fmt
->
nAvgBytesPerSec
!=
fmt
->
nBlockAlign
*
fmt
->
nSamplesPerSec
||
(
fmt
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
&&
((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
Samples
.
wValidBitsPerSample
<
fmt
->
wBitsPerSample
))
hr
=
S_FALSE
;
if
(
mode
==
AUDCLNT_SHAREMODE_EXCLUSIVE
&&
fmt
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
){
if
(((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
dwChannelMask
==
0
||
((
WAVEFORMATEXTENSIBLE
*
)
fmt
)
->
dwChannelMask
&
SPEAKER_RESERVED
)
hr
=
S_FALSE
;
}
exit:
LeaveCriticalSection
(
&
This
->
lock
);
HeapFree
(
GetProcessHeap
(),
0
,
formats
);
...
...
@@ -1676,6 +1704,8 @@ exit:
closest
->
nChannels
*
closest
->
wBitsPerSample
/
8
;
closest
->
nAvgBytesPerSec
=
closest
->
nBlockAlign
*
closest
->
nSamplesPerSec
;
if
(
closest
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
((
WAVEFORMATEXTENSIBLE
*
)
closest
)
->
Samples
.
wValidBitsPerSample
=
closest
->
wBitsPerSample
;
*
out
=
closest
;
}
else
CoTaskMemFree
(
closest
);
...
...
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