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
b5aec2e4
Commit
b5aec2e4
authored
Jan 11, 2015
by
Mark Harmstone
Committed by
Alexandre Julliard
Jan 13, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Degrade speaker config if too many channels.
parent
dcf8767b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
dsound_private.h
dlls/dsound/dsound_private.h
+1
-0
primary.c
dlls/dsound/primary.c
+10
-7
No files found.
dlls/dsound/dsound_private.h
View file @
b5aec2e4
...
...
@@ -219,6 +219,7 @@ HRESULT DSOUND_PrimaryGetPosition(DirectSoundDevice *device, LPDWORD playpos, LP
LPWAVEFORMATEX
DSOUND_CopyFormat
(
LPCWAVEFORMATEX
wfex
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_ReopenDevice
(
DirectSoundDevice
*
device
,
BOOL
forcewave
)
DECLSPEC_HIDDEN
;
HRESULT
DSOUND_PrimaryOpen
(
DirectSoundDevice
*
device
)
DECLSPEC_HIDDEN
;
DWORD
DSOUND_FindSpeakerConfig
(
IMMDevice
*
mmdevice
,
int
channels
)
DECLSPEC_HIDDEN
;
HRESULT
primarybuffer_create
(
DirectSoundDevice
*
device
,
IDirectSoundBufferImpl
**
ppdsb
,
const
DSBUFFERDESC
*
dsbd
)
DECLSPEC_HIDDEN
;
void
primarybuffer_destroy
(
IDirectSoundBufferImpl
*
This
)
DECLSPEC_HIDDEN
;
...
...
dlls/dsound/primary.c
View file @
b5aec2e4
...
...
@@ -93,7 +93,10 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client
if
(
FAILED
(
hr
))
return
hr
;
if
(
mixwfe
->
Format
.
nChannels
>
device
->
num_speakers
)
{
if
(
mixwfe
->
Format
.
nChannels
<
device
->
num_speakers
)
{
device
->
speaker_config
=
DSOUND_FindSpeakerConfig
(
device
->
mmdevice
,
mixwfe
->
Format
.
nChannels
);
DSOUND_ParseSpeakerConfig
(
device
);
}
else
if
(
mixwfe
->
Format
.
nChannels
>
device
->
num_speakers
)
{
mixwfe
->
Format
.
nChannels
=
device
->
num_speakers
;
mixwfe
->
Format
.
nBlockAlign
=
mixwfe
->
Format
.
nChannels
*
mixwfe
->
Format
.
wBitsPerSample
/
8
;
mixwfe
->
Format
.
nAvgBytesPerSec
=
mixwfe
->
Format
.
nSamplesPerSec
*
mixwfe
->
Format
.
nBlockAlign
;
...
...
@@ -163,7 +166,7 @@ static HRESULT DSOUND_WaveFormat(DirectSoundDevice *device, IAudioClient *client
return
S_OK
;
}
static
DWORD
DSOUND_FindSpeakerConfig
(
IMMDevice
*
mmdevice
)
DWORD
DSOUND_FindSpeakerConfig
(
IMMDevice
*
mmdevice
,
int
channels
)
{
IPropertyStore
*
store
;
HRESULT
hr
;
...
...
@@ -198,13 +201,13 @@ static DWORD DSOUND_FindSpeakerConfig(IMMDevice *mmdevice)
PropVariantClear
(
&
pv
);
IPropertyStore_Release
(
store
);
if
((
phys_speakers
&
KSAUDIO_SPEAKER_5POINT1
)
==
KSAUDIO_SPEAKER_5POINT1
)
if
((
channels
>=
6
||
channels
==
0
)
&&
(
phys_speakers
&
KSAUDIO_SPEAKER_5POINT1
)
==
KSAUDIO_SPEAKER_5POINT1
)
return
DSSPEAKER_5POINT1_BACK
;
else
if
((
phys_speakers
&
KSAUDIO_SPEAKER_5POINT1_SURROUND
)
==
KSAUDIO_SPEAKER_5POINT1_SURROUND
)
else
if
((
channels
>=
6
||
channels
==
0
)
&&
(
phys_speakers
&
KSAUDIO_SPEAKER_5POINT1_SURROUND
)
==
KSAUDIO_SPEAKER_5POINT1_SURROUND
)
return
DSSPEAKER_5POINT1_SURROUND
;
else
if
((
phys_speakers
&
KSAUDIO_SPEAKER_QUAD
)
==
KSAUDIO_SPEAKER_QUAD
)
else
if
((
channels
>=
4
||
channels
==
0
)
&&
(
phys_speakers
&
KSAUDIO_SPEAKER_QUAD
)
==
KSAUDIO_SPEAKER_QUAD
)
return
DSSPEAKER_QUAD
;
else
if
((
phys_speakers
&
KSAUDIO_SPEAKER_STEREO
)
==
KSAUDIO_SPEAKER_STEREO
)
else
if
((
channels
>=
2
||
channels
==
0
)
&&
(
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
;
...
...
@@ -247,7 +250,7 @@ HRESULT DSOUND_ReopenDevice(DirectSoundDevice *device, BOOL forcewave)
return
hres
;
}
device
->
speaker_config
=
DSOUND_FindSpeakerConfig
(
device
->
mmdevice
);
device
->
speaker_config
=
DSOUND_FindSpeakerConfig
(
device
->
mmdevice
,
0
);
DSOUND_ParseSpeakerConfig
(
device
);
...
...
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