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
52345858
Commit
52345858
authored
Dec 31, 2014
by
Mark Harmstone
Committed by
Alexandre Julliard
Jan 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Get speaker config from mmdevice props.
Use PKEY_AudioEndpoint_PhysicalSpeakers to set the speaker config in dsound.
parent
a48c7fe4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
primary.c
dlls/dsound/primary.c
+45
-0
No files found.
dlls/dsound/primary.c
View file @
52345858
...
...
@@ -146,6 +146,49 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client
return
S_OK
;
}
static
DWORD
DSOUND_FindSpeakerConfig
(
IMMDevice
*
mmdevice
)
{
IPropertyStore
*
store
;
HRESULT
hr
;
PROPVARIANT
pv
;
ULONG
phys_speakers
;
const
DWORD
def
=
DSSPEAKER_COMBINED
(
DSSPEAKER_STEREO
,
DSSPEAKER_GEOMETRY_WIDE
);
hr
=
IMMDevice_OpenPropertyStore
(
mmdevice
,
STGM_READ
,
&
store
);
if
(
FAILED
(
hr
))
{
WARN
(
"IMMDevice_OpenPropertyStore failed: %08x
\n
"
,
hr
);
return
def
;
}
hr
=
IPropertyStore_GetValue
(
store
,
&
PKEY_AudioEndpoint_PhysicalSpeakers
,
&
pv
);
if
(
FAILED
(
hr
))
{
WARN
(
"IPropertyStore_GetValue failed: %08x
\n
"
,
hr
);
IPropertyStore_Release
(
store
);
return
def
;
}
if
(
pv
.
vt
!=
VT_UI4
)
{
WARN
(
"PKEY_AudioEndpoint_PhysicalSpeakers is not a ULONG: 0x%x
\n
"
,
pv
.
vt
);
PropVariantClear
(
&
pv
);
IPropertyStore_Release
(
store
);
return
def
;
}
phys_speakers
=
pv
.
u
.
ulVal
;
PropVariantClear
(
&
pv
);
IPropertyStore_Release
(
store
);
if
((
phys_speakers
&
KSAUDIO_SPEAKER_STEREO
)
==
KSAUDIO_SPEAKER_STEREO
)
return
DSSPEAKER_COMBINED
(
DSSPEAKER_STEREO
,
DSSPEAKER_GEOMETRY_WIDE
);
else
if
((
phys_speakers
&
KSAUDIO_SPEAKER_MONO
)
==
KSAUDIO_SPEAKER_MONO
)
return
DSSPEAKER_MONO
;
return
def
;
}
HRESULT
DSOUND_ReopenDevice
(
DirectSoundDevice
*
device
,
BOOL
forcewave
)
{
UINT
prebuf_frames
;
...
...
@@ -181,6 +224,8 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave)
return
hres
;
}
device
->
speaker_config
=
DSOUND_FindSpeakerConfig
(
device
->
mmdevice
);
hres
=
DSOUND_WaveFormat
(
device
,
device
->
client
,
forcewave
,
&
wfx
);
if
(
FAILED
(
hres
))
{
IAudioClient_Release
(
device
->
client
);
...
...
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