Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
e9da9535
Commit
e9da9535
authored
Apr 15, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simple downmixer: allow Xiph 6.1 -> 5.1
Close #7899
parent
d8ae3c5a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
modules/audio_filter/channel_mixer/simple.c
modules/audio_filter/channel_mixer/simple.c
+27
-3
No files found.
modules/audio_filter/channel_mixer/simple.c
View file @
e9da9535
...
@@ -92,6 +92,7 @@ static bool IsSupported( const audio_format_t *p_input, const audio_format_t *p_
...
@@ -92,6 +92,7 @@ static bool IsSupported( const audio_format_t *p_input, const audio_format_t *p_
* TODO: We don't support 4.0 rear and 4.0 middle
* TODO: We don't support 4.0 rear and 4.0 middle
* */
* */
if
(
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_7_0
&&
if
(
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_7_0
&&
(
p_input
->
i_physical_channels
)
!=
AOUT_CHANS_6_1_MIDDLE
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_5_0
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_5_0
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_5_0_MIDDLE
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_5_0_MIDDLE
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_4_CENTER_REAR
&&
(
p_input
->
i_physical_channels
&
~
AOUT_CHAN_LFE
)
!=
AOUT_CHANS_4_CENTER_REAR
&&
...
@@ -278,6 +279,24 @@ static void DoWork_7_x_to_5_x( filter_t * p_filter, block_t * p_in_buf, block_t
...
@@ -278,6 +279,24 @@ static void DoWork_7_x_to_5_x( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
}
}
static
void
DoWork_6_1_to_5_x
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
,
block_t
*
p_out_buf
)
{
float
*
p_dest
=
(
float
*
)
p_out_buf
->
p_buffer
;
const
float
*
p_src
=
(
const
float
*
)
p_in_buf
->
p_buffer
;
for
(
int
i
=
p_in_buf
->
i_nb_samples
;
i
--
;
)
{
*
p_dest
++
=
p_src
[
0
];
*
p_dest
++
=
p_src
[
1
];
*
p_dest
++
=
(
p_src
[
2
]
+
p_src
[
4
])
*
0
.
5
;
*
p_dest
++
=
(
p_src
[
3
]
+
p_src
[
4
])
*
0
.
5
;
*
p_dest
++
=
p_src
[
5
];
p_src
+=
6
;
/* We always have LFE here */
*
p_dest
++
=
*
p_src
++
;
}
}
/*****************************************************************************
/*****************************************************************************
* OpenFilter:
* OpenFilter:
...
@@ -304,7 +323,9 @@ static int OpenFilter( vlc_object_t *p_this )
...
@@ -304,7 +323,9 @@ static int OpenFilter( vlc_object_t *p_this )
const
unsigned
i_input_physical
=
p_filter
->
fmt_in
.
audio
.
i_physical_channels
;
const
unsigned
i_input_physical
=
p_filter
->
fmt_in
.
audio
.
i_physical_channels
;
const
bool
b_input_7_0
=
(
i_input_physical
&
~
AOUT_CHAN_LFE
)
==
AOUT_CHANS_7_0
;
const
bool
b_input_7_0
=
(
i_input_physical
&
~
AOUT_CHAN_LFE
)
==
AOUT_CHANS_7_0
;
const
bool
b_input_5_0
=
!
b_input_7_0
&&
const
bool
b_input_6_1
=
!
b_input_7_0
&&
i_input_physical
==
AOUT_CHANS_6_1_MIDDLE
;
const
bool
b_input_5_0
=
!
b_input_7_0
&&
!
b_input_6_1
&&
(
(
i_input_physical
&
AOUT_CHANS_5_0
)
==
AOUT_CHANS_5_0
||
(
(
i_input_physical
&
AOUT_CHANS_5_0
)
==
AOUT_CHANS_5_0
||
(
i_input_physical
&
AOUT_CHANS_5_0_MIDDLE
)
==
AOUT_CHANS_5_0_MIDDLE
);
(
i_input_physical
&
AOUT_CHANS_5_0_MIDDLE
)
==
AOUT_CHANS_5_0_MIDDLE
);
const
bool
b_input_4_center_rear
=
!
b_input_7_0
&&
!
b_input_5_0
&&
const
bool
b_input_4_center_rear
=
!
b_input_7_0
&&
!
b_input_5_0
&&
...
@@ -345,8 +366,11 @@ static int OpenFilter( vlc_object_t *p_this )
...
@@ -345,8 +366,11 @@ static int OpenFilter( vlc_object_t *p_this )
}
}
else
else
{
{
assert
(
b_input_7_0
);
assert
(
b_input_7_0
||
b_input_6_1
);
if
(
b_input_7_0
)
p_filter
->
p_sys
->
pf_dowork
=
DoWork_7_x_to_5_x
;
p_filter
->
p_sys
->
pf_dowork
=
DoWork_7_x_to_5_x
;
else
p_filter
->
p_sys
->
pf_dowork
=
DoWork_6_1_to_5_x
;
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
...
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