Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Thomas Guillem
vlc-legacy
Commits
3ffd20e6
Commit
3ffd20e6
authored
Oct 13, 2016
by
Thomas Guillem
Browse files
wasapi: don't up-mix
parent
8a449a61
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/audio_output/wasapi.c
View file @
3ffd20e6
...
...
@@ -367,15 +367,14 @@ static void vlc_ToWave(WAVEFORMATEXTENSIBLE *restrict wf,
wf
->
dwChannelMask
|=
chans_in
[
i
];
}
static
int
vlc_FromWave
(
const
WAVEFORMATEX
*
restrict
wf
,
static
int
vlc_FromWave
(
WAVEFORMATEX
*
restrict
wf
,
audio_sample_format_t
*
restrict
audio
)
{
audio
->
i_rate
=
wf
->
nSamplesPerSec
;
audio
->
i_physical_channels
=
0
;
if
(
wf
->
wFormatTag
==
WAVE_FORMAT_EXTENSIBLE
)
{
const
WAVEFORMATEXTENSIBLE
*
wfe
=
(
void
*
)
wf
;
WAVEFORMATEXTENSIBLE
*
wfe
=
(
void
*
)
wf
;
if
(
IsEqualIID
(
&
wfe
->
SubFormat
,
&
KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
))
{
...
...
@@ -409,18 +408,32 @@ static int vlc_FromWave(const WAVEFORMATEX *restrict wf,
if
(
wfe
->
Samples
.
wValidBitsPerSample
!=
wf
->
wBitsPerSample
)
return
-
1
;
for
(
unsigned
i
=
0
;
chans_in
[
i
];
i
++
)
if
(
wfe
->
dwChannelMask
&
chans_in
[
i
])
audio
->
i_physical_channels
|=
pi_vlc_chan_order_wg4
[
i
];
if
(
wf
->
nChannels
<=
audio
->
i_channels
)
{
/* VLC will downmix to match the modified format */
audio
->
i_physical_channels
=
0
;
for
(
unsigned
i
=
0
;
chans_in
[
i
];
i
++
)
if
(
wfe
->
dwChannelMask
&
chans_in
[
i
])
audio
->
i_physical_channels
|=
pi_vlc_chan_order_wg4
[
i
];
audio
->
i_original_channels
=
audio
->
i_physical_channels
;
aout_FormatPrepare
(
audio
);
if
(
wf
->
nChannels
!=
audio
->
i_channels
)
return
-
1
;
}
else
{
/* Force the modified format channels to VLC one in order to avoid
* a useless up-mixing */
wfe
->
dwChannelMask
=
0
;
for
(
unsigned
i
=
0
;
pi_vlc_chan_order_wg4
[
i
];
i
++
)
if
(
audio
->
i_physical_channels
&
pi_vlc_chan_order_wg4
[
i
])
wfe
->
dwChannelMask
|=
chans_in
[
i
];
wf
->
nChannels
=
audio
->
i_channels
;
}
}
else
return
-
1
;
audio
->
i_original_channels
=
audio
->
i_physical_channels
;
aout_FormatPrepare
(
audio
);
if
(
wf
->
nChannels
!=
audio
->
i_channels
)
return
-
1
;
return
0
;
}
...
...
Write
Preview
Supports
Markdown
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