Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
80a28c75
Commit
80a28c75
authored
Apr 12, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swresample: Allow reinitialization without ever setting channel layouts
parent
d7b9cb2f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
8 deletions
+13
-8
options.c
libswresample/options.c
+4
-4
rematrix.c
libswresample/rematrix.c
+2
-2
swresample.c
libswresample/swresample.c
+5
-2
swresample_internal.h
libswresample/swresample_internal.h
+2
-0
No files found.
libswresample/options.c
View file @
80a28c75
...
...
@@ -51,10 +51,10 @@ static const AVOption options[]={
{
"out_sample_fmt"
,
"set output sample format"
,
OFFSET
(
out_sample_fmt
),
AV_OPT_TYPE_SAMPLE_FMT
,
{.
i64
=
AV_SAMPLE_FMT_NONE
},
-
1
,
INT_MAX
,
PARAM
},
{
"tsf"
,
"set internal sample format"
,
OFFSET
(
int_sample_fmt
),
AV_OPT_TYPE_SAMPLE_FMT
,
{.
i64
=
AV_SAMPLE_FMT_NONE
},
-
1
,
INT_MAX
,
PARAM
},
{
"internal_sample_fmt"
,
"set internal sample format"
,
OFFSET
(
int_sample_fmt
),
AV_OPT_TYPE_SAMPLE_FMT
,
{.
i64
=
AV_SAMPLE_FMT_NONE
},
-
1
,
INT_MAX
,
PARAM
},
{
"icl"
,
"set input channel layout"
,
OFFSET
(
in_ch_layout
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=
0
},
0
,
INT64_MAX
,
PARAM
,
"channel_layout"
},
{
"in_channel_layout"
,
"set input channel layout"
,
OFFSET
(
in_ch_layout
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=
0
},
0
,
INT64_MAX
,
PARAM
,
"channel_layout"
},
{
"ocl"
,
"set output channel layout"
,
OFFSET
(
out_ch_layout
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=
0
},
0
,
INT64_MAX
,
PARAM
,
"channel_layout"
},
{
"out_channel_layout"
,
"set output channel layout"
,
OFFSET
(
out_ch_layout
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=
0
},
0
,
INT64_MAX
,
PARAM
,
"channel_layout"
},
{
"icl"
,
"set input channel layout"
,
OFFSET
(
user_in_ch_layout
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=
0
},
0
,
INT64_MAX
,
PARAM
,
"channel_layout"
},
{
"in_channel_layout"
,
"set input channel layout"
,
OFFSET
(
user_in_ch_layout
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=
0
},
0
,
INT64_MAX
,
PARAM
,
"channel_layout"
},
{
"ocl"
,
"set output channel layout"
,
OFFSET
(
user_out_ch_layout
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=
0
},
0
,
INT64_MAX
,
PARAM
,
"channel_layout"
},
{
"out_channel_layout"
,
"set output channel layout"
,
OFFSET
(
user_out_ch_layout
),
AV_OPT_TYPE_CHANNEL_LAYOUT
,
{.
i64
=
0
},
0
,
INT64_MAX
,
PARAM
,
"channel_layout"
},
{
"clev"
,
"set center mix level"
,
OFFSET
(
clev
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
C_30DB
},
-
32
,
32
,
PARAM
},
{
"center_mix_level"
,
"set center mix level"
,
OFFSET
(
clev
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
C_30DB
},
-
32
,
32
,
PARAM
},
{
"slev"
,
"set surround mix level"
,
OFFSET
(
slev
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
C_30DB
},
-
32
,
32
,
PARAM
},
...
...
libswresample/rematrix.c
View file @
80a28c75
...
...
@@ -65,8 +65,8 @@ int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride)
if
(
!
s
||
s
->
in_convert
)
// s needs to be allocated but not initialized
return
AVERROR
(
EINVAL
);
memset
(
s
->
matrix
,
0
,
sizeof
(
s
->
matrix
));
nb_in
=
av_get_channel_layout_nb_channels
(
s
->
in_ch_layout
);
nb_out
=
av_get_channel_layout_nb_channels
(
s
->
out_ch_layout
);
nb_in
=
av_get_channel_layout_nb_channels
(
s
->
user_
in_ch_layout
);
nb_out
=
av_get_channel_layout_nb_channels
(
s
->
user_
out_ch_layout
);
for
(
out
=
0
;
out
<
nb_out
;
out
++
)
{
for
(
in
=
0
;
in
<
nb_in
;
in
++
)
s
->
matrix
[
out
][
in
]
=
matrix
[
in
];
...
...
libswresample/swresample.c
View file @
80a28c75
...
...
@@ -86,10 +86,10 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
if
(
av_opt_set_int
(
s
,
"tsf"
,
AV_SAMPLE_FMT_NONE
,
0
)
<
0
)
goto
fail
;
if
(
av_opt_set_int
(
s
,
"ich"
,
av_get_channel_layout_nb_channels
(
s
->
in_ch_layout
),
0
)
<
0
)
if
(
av_opt_set_int
(
s
,
"ich"
,
av_get_channel_layout_nb_channels
(
s
->
user_
in_ch_layout
),
0
)
<
0
)
goto
fail
;
if
(
av_opt_set_int
(
s
,
"och"
,
av_get_channel_layout_nb_channels
(
s
->
out_ch_layout
),
0
)
<
0
)
if
(
av_opt_set_int
(
s
,
"och"
,
av_get_channel_layout_nb_channels
(
s
->
user_
out_ch_layout
),
0
)
<
0
)
goto
fail
;
av_opt_set_int
(
s
,
"uch"
,
0
,
0
);
...
...
@@ -168,6 +168,9 @@ av_cold int swr_init(struct SwrContext *s){
s
->
in
.
ch_count
=
s
->
user_in_ch_count
;
s
->
used_ch_count
=
s
->
user_used_ch_count
;
s
->
in_ch_layout
=
s
->
user_in_ch_layout
;
s
->
out_ch_layout
=
s
->
user_out_ch_layout
;
if
(
av_get_channel_layout_nb_channels
(
s
->
in_ch_layout
)
>
SWR_CH_MAX
)
{
av_log
(
s
,
AV_LOG_WARNING
,
"Input channel layout 0x%"
PRIx64
" is invalid or unsupported.
\n
"
,
s
->
in_ch_layout
);
s
->
in_ch_layout
=
0
;
...
...
libswresample/swresample_internal.h
View file @
80a28c75
...
...
@@ -115,6 +115,8 @@ struct SwrContext {
int
user_in_ch_count
;
///< User set input channel count
int
user_out_ch_count
;
///< User set output channel count
int
user_used_ch_count
;
///< User set used channel count
int64_t
user_in_ch_layout
;
///< User set input channel layout
int64_t
user_out_ch_layout
;
///< User set output channel layout
struct
DitherContext
dither
;
...
...
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