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
d7b9cb2f
Commit
d7b9cb2f
authored
Apr 12, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swresample: Allow reinitialization without ever setting channel counts
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
14edc9f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
options.c
libswresample/options.c
+6
-6
swresample.c
libswresample/swresample.c
+4
-0
swresample_internal.h
libswresample/swresample_internal.h
+4
-0
No files found.
libswresample/options.c
View file @
d7b9cb2f
...
...
@@ -35,12 +35,12 @@
#define PARAM AV_OPT_FLAG_AUDIO_PARAM
static
const
AVOption
options
[]
=
{
{
"ich"
,
"set input channel count"
,
OFFSET
(
in
.
ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"in_channel_count"
,
"set input channel count"
,
OFFSET
(
in
.
ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"och"
,
"set output channel count"
,
OFFSET
(
out
.
ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"out_channel_count"
,
"set output channel count"
,
OFFSET
(
out
.
ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"uch"
,
"set used channel count"
,
OFFSET
(
use
d_ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"used_channel_count"
,
"set used channel count"
,
OFFSET
(
use
d_ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"ich"
,
"set input channel count"
,
OFFSET
(
user_in_ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"in_channel_count"
,
"set input channel count"
,
OFFSET
(
user_in_ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"och"
,
"set output channel count"
,
OFFSET
(
user_out_ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"out_channel_count"
,
"set output channel count"
,
OFFSET
(
user_out_ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"uch"
,
"set used channel count"
,
OFFSET
(
use
r_used_ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"used_channel_count"
,
"set used channel count"
,
OFFSET
(
use
r_used_ch_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
SWR_CH_MAX
,
PARAM
},
{
"isr"
,
"set input sample rate"
,
OFFSET
(
in_sample_rate
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
PARAM
},
{
"in_sample_rate"
,
"set input sample rate"
,
OFFSET
(
in_sample_rate
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
PARAM
},
{
"osr"
,
"set output sample rate"
,
OFFSET
(
out_sample_rate
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
PARAM
},
...
...
libswresample/swresample.c
View file @
d7b9cb2f
...
...
@@ -164,6 +164,10 @@ av_cold int swr_init(struct SwrContext *s){
return
AVERROR
(
EINVAL
);
}
s
->
out
.
ch_count
=
s
->
user_out_ch_count
;
s
->
in
.
ch_count
=
s
->
user_in_ch_count
;
s
->
used_ch_count
=
s
->
user_used_ch_count
;
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 @
d7b9cb2f
...
...
@@ -112,6 +112,10 @@ struct SwrContext {
int
used_ch_count
;
///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count)
int
engine
;
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
struct
DitherContext
dither
;
int
filter_size
;
/**< length of each FIR filter in the resampling filterbank relative to the cutoff frequency */
...
...
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