Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1def346b
Commit
1def346b
authored
May 19, 2016
by
Andrew Eikum
Committed by
Alexandre Julliard
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Support downmixing quadraphonic to stereo.
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
88dd3b4f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
dsound_convert.c
dlls/dsound/dsound_convert.c
+27
-0
dsound_private.h
dlls/dsound/dsound_private.h
+1
-0
mixer.c
dlls/dsound/mixer.c
+6
-0
No files found.
dlls/dsound/dsound_convert.c
View file @
1def346b
...
...
@@ -252,6 +252,33 @@ void put_surround512stereo(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD c
}
}
void
put_quad2stereo
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
{
/* based on pulseaudio's downmix algorithm */
switch
(
channel
){
case
2
:
/* back left */
value
*=
0
.
1
f
;
/* (1/9) / (sum of left volumes) */
dsb
->
put_aux
(
dsb
,
pos
,
0
,
value
);
break
;
case
0
:
/* front left */
value
*=
0
.
9
f
;
/* 1 / (sum of left volumes) */
dsb
->
put_aux
(
dsb
,
pos
,
0
,
value
);
break
;
case
3
:
/* back right */
value
*=
0
.
1
f
;
/* (1/9) / (sum of right volumes) */
dsb
->
put_aux
(
dsb
,
pos
,
1
,
value
);
break
;
case
1
:
/* front right */
value
*=
0
.
9
f
;
/* 1 / (sum of right volumes) */
dsb
->
put_aux
(
dsb
,
pos
,
1
,
value
);
break
;
}
}
void
mixieee32
(
float
*
src
,
float
*
dst
,
unsigned
samples
)
{
TRACE
(
"%p - %p %d
\n
"
,
src
,
dst
,
samples
);
...
...
dlls/dsound/dsound_private.h
View file @
1def346b
...
...
@@ -179,6 +179,7 @@ void put_stereo2quad(const IDirectSoundBufferImpl *dsb, DWORD pos, DWORD channel
void
put_mono2surround51
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
DECLSPEC_HIDDEN
;
void
put_stereo2surround51
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
DECLSPEC_HIDDEN
;
void
put_surround512stereo
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
DECLSPEC_HIDDEN
;
void
put_quad2stereo
(
const
IDirectSoundBufferImpl
*
dsb
,
DWORD
pos
,
DWORD
channel
,
float
value
)
DECLSPEC_HIDDEN
;
HRESULT
secondarybuffer_create
(
DirectSoundDevice
*
device
,
const
DSBUFFERDESC
*
dsbd
,
IDirectSoundBuffer
**
buffer
)
DECLSPEC_HIDDEN
;
...
...
dlls/dsound/mixer.c
View file @
1def346b
...
...
@@ -179,6 +179,12 @@ void DSOUND_RecalcFormat(IDirectSoundBufferImpl *dsb)
dsb
->
put
=
put_surround512stereo
;
dsb
->
put_aux
=
putieee32_sum
;
}
else
if
(
ichannels
==
4
&&
ochannels
==
2
)
{
dsb
->
mix_channels
=
4
;
dsb
->
put
=
put_quad2stereo
;
dsb
->
put_aux
=
putieee32_sum
;
}
else
{
if
(
ichannels
>
2
)
...
...
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