Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
c8ffab06
Commit
c8ffab06
authored
Sep 08, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swr/auto_matrix: add clean layout function
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ebc854e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
rematrix.c
libswresample/rematrix.c
+9
-1
No files found.
libswresample/rematrix.c
View file @
c8ffab06
...
...
@@ -102,6 +102,11 @@ static int even(int64_t layout){
return
0
;
}
static
int
clean_layout
(
SwrContext
*
s
,
int64_t
layout
){
return
layout
;
}
static
int
sane_layout
(
int64_t
layout
){
if
(
!
(
layout
&
AV_CH_LAYOUT_SURROUND
))
// at least 1 front speaker
return
0
;
...
...
@@ -123,16 +128,19 @@ static int auto_matrix(SwrContext *s)
{
int
i
,
j
,
out_i
;
double
matrix
[
64
][
64
]
=
{{
0
}};
int64_t
unaccounted
,
in_ch_layout
=
s
->
in_ch_layout
,
out_ch_layout
=
s
->
out_ch_layout
;
int64_t
unaccounted
,
in_ch_layout
,
out_ch_layout
;
double
maxcoef
=
0
;
char
buf
[
128
];
const
int
matrix_encoding
=
s
->
matrix_encoding
;
in_ch_layout
=
clean_layout
(
s
,
s
->
in_ch_layout
);
if
(
!
sane_layout
(
in_ch_layout
)){
av_get_channel_layout_string
(
buf
,
sizeof
(
buf
),
-
1
,
s
->
in_ch_layout
);
av_log
(
s
,
AV_LOG_ERROR
,
"Input channel layout '%s' is not supported
\n
"
,
buf
);
return
AVERROR
(
EINVAL
);
}
out_ch_layout
=
clean_layout
(
s
,
s
->
out_ch_layout
);
if
(
!
sane_layout
(
out_ch_layout
)){
av_get_channel_layout_string
(
buf
,
sizeof
(
buf
),
-
1
,
s
->
out_ch_layout
);
av_log
(
s
,
AV_LOG_ERROR
,
"Output channel layout '%s' is not supported
\n
"
,
buf
);
...
...
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