Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
22ccb7a2
Commit
22ccb7a2
authored
Sep 08, 2013
by
Denis Charmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't use more aout channels than the stream actually has to avoid upmix.
Fix #9342
parent
0f93aae7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
6 deletions
+31
-6
modules/audio_output/directx.c
modules/audio_output/directx.c
+31
-6
No files found.
modules/audio_output/directx.c
View file @
22ccb7a2
...
@@ -185,6 +185,8 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
...
@@ -185,6 +185,8 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
if
(
i
==
0
)
if
(
i
==
0
)
{
{
DWORD
ui_speaker_config
;
DWORD
ui_speaker_config
;
int
i_channels
=
2
;
/* Default to stereo */
int
i_orig_channels
=
aout_FormatNbChannels
(
fmt
);
/* Check the speaker configuration to determine which channel config
/* Check the speaker configuration to determine which channel config
* should be the default */
* should be the default */
...
@@ -194,7 +196,6 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
...
@@ -194,7 +196,6 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
ui_speaker_config
=
DSSPEAKER_STEREO
;
ui_speaker_config
=
DSSPEAKER_STEREO
;
msg_Dbg
(
p_aout
,
"GetSpeakerConfig failed"
);
msg_Dbg
(
p_aout
,
"GetSpeakerConfig failed"
);
}
}
fmt
->
i_physical_channels
=
AOUT_CHANS_2_0
;
const
char
*
name
=
"Unknown"
;
const
char
*
name
=
"Unknown"
;
switch
(
DSSPEAKER_CONFIG
(
ui_speaker_config
)
)
switch
(
DSSPEAKER_CONFIG
(
ui_speaker_config
)
)
...
@@ -202,16 +203,16 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
...
@@ -202,16 +203,16 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
case
DSSPEAKER_7POINT1
:
case
DSSPEAKER_7POINT1
:
case
DSSPEAKER_7POINT1_SURROUND
:
case
DSSPEAKER_7POINT1_SURROUND
:
name
=
"7.1"
;
name
=
"7.1"
;
fmt
->
i_physical_channels
=
AOUT_CHANS_7_1
;
i_channels
=
8
;
break
;
break
;
case
DSSPEAKER_5POINT1
:
case
DSSPEAKER_5POINT1
:
case
DSSPEAKER_5POINT1_SURROUND
:
case
DSSPEAKER_5POINT1_SURROUND
:
name
=
"5.1"
;
name
=
"5.1"
;
fmt
->
i_physical_channels
=
AOUT_CHANS_5_1
;
i_channels
=
6
;
break
;
break
;
case
DSSPEAKER_QUAD
:
case
DSSPEAKER_QUAD
:
name
=
"Quad"
;
name
=
"Quad"
;
fmt
->
i_physical_channels
=
AOUT_CHANS_4_0
;
i_channels
=
4
;
break
;
break
;
#if 0 /* Lots of people just get their settings wrong and complain that
#if 0 /* Lots of people just get their settings wrong and complain that
* this is a problem with VLC so just don't ever set mono by default. */
* this is a problem with VLC so just don't ever set mono by default. */
...
@@ -220,14 +221,38 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
...
@@ -220,14 +221,38 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
fmt->i_physical_channels = AOUT_CHAN_CENTER;
fmt->i_physical_channels = AOUT_CHAN_CENTER;
break;
break;
#endif
#endif
case
DSSPEAKER_SURROUND
:
/* XXX: stereo, really? -- Courmisch */
case
DSSPEAKER_SURROUND
:
name
=
"Surround"
;
name
=
"Surround"
;
i_channels
=
4
;
break
;
break
;
case
DSSPEAKER_STEREO
:
case
DSSPEAKER_STEREO
:
name
=
"Stereo"
;
name
=
"Stereo"
;
i_channels
=
2
;
break
;
}
i_channels
=
(
i_channels
<
i_orig_channels
)
?
i_channels
:
i_orig_channels
;
msg_Dbg
(
p_aout
,
"%s speaker config: %s and stream has %d channels, using %d channels"
,
"Windows"
,
name
,
i_orig_channels
,
i_channels
);
switch
(
i_channels
)
{
case
8
:
fmt
->
i_physical_channels
=
AOUT_CHANS_7_1
;
break
;
case
7
:
case
6
:
fmt
->
i_physical_channels
=
AOUT_CHANS_5_1
;
break
;
case
5
:
case
4
:
fmt
->
i_physical_channels
=
AOUT_CHANS_4_0
;
break
;
default:
fmt
->
i_physical_channels
=
AOUT_CHANS_2_0
;
break
;
break
;
}
}
msg_Dbg
(
p_aout
,
"%s speaker config: %s"
,
"Windows"
,
name
);
}
}
else
else
{
/* Overriden speaker configuration */
{
/* Overriden speaker configuration */
...
...
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