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
af20740d
Commit
af20740d
authored
Dec 03, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
Dec 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio.drv: Improve IsFormatSupported handling.
parent
e84f05bc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
6 deletions
+41
-6
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+41
-6
No files found.
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
af20740d
...
...
@@ -1131,6 +1131,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
)
...
...
@@ -1445,12 +1451,31 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
dump_fmt
(
pwfx
);
if
(
outpwfx
)
if
(
outpwfx
)
{
*
outpwfx
=
NULL
;
if
(
mode
!=
AUDCLNT_SHAREMODE_SHARED
)
outpwfx
=
NULL
;
}
if
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
&&
fmtex
->
dwChannelMask
!=
0
&&
fmtex
->
dwChannelMask
!=
get_channel_mask
(
pwfx
->
nChannels
))
if
(
pwfx
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
){
if
(
pwfx
->
nAvgBytesPerSec
==
0
||
pwfx
->
nBlockAlign
==
0
||
fmtex
->
Samples
.
wValidBitsPerSample
>
pwfx
->
wBitsPerSample
)
return
E_INVALIDARG
;
if
(
fmtex
->
Samples
.
wValidBitsPerSample
<
pwfx
->
wBitsPerSample
)
goto
unsupported
;
if
(
mode
==
AUDCLNT_SHAREMODE_EXCLUSIVE
){
if
(
fmtex
->
dwChannelMask
==
0
||
fmtex
->
dwChannelMask
&
SPEAKER_RESERVED
)
goto
unsupported
;
}
}
if
(
pwfx
->
nBlockAlign
!=
pwfx
->
nChannels
*
pwfx
->
wBitsPerSample
/
8
||
pwfx
->
nAvgBytesPerSec
!=
pwfx
->
nBlockAlign
*
pwfx
->
nSamplesPerSec
)
goto
unsupported
;
if
(
pwfx
->
nChannels
==
0
)
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
OSSpinLockLock
(
&
This
->
lock
);
...
...
@@ -1462,10 +1487,20 @@ static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient *iface,
TRACE
(
"returning %08x
\n
"
,
S_OK
);
return
S_OK
;
}
OSSpinLockUnlock
(
&
This
->
lock
);
if
(
hr
!=
AUDCLNT_E_UNSUPPORTED_FORMAT
){
TRACE
(
"returning %08x
\n
"
,
hr
);
return
hr
;
}
unsupported:
if
(
outpwfx
){
hr
=
IAudioClient_GetMixFormat
(
&
This
->
IAudioClient_iface
,
outpwfx
);
if
(
FAILED
(
hr
))
return
hr
;
return
S_FALSE
;
}
TRACE
(
"returning %08x
\n
"
,
AUDCLNT_E_UNSUPPORTED_FORMAT
);
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
}
...
...
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