Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
f9e55c0f
Commit
f9e55c0f
authored
12 years ago
by
Michael Niedermayer
Browse files
Options
Downloads
Patches
Plain Diff
swr: support -async X as a simple way to do what ffmpeg -async X did
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
0b980e57
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libswresample/swresample.c
+10
-0
10 additions, 0 deletions
libswresample/swresample.c
libswresample/swresample_internal.h
+1
-0
1 addition, 0 deletions
libswresample/swresample_internal.h
with
11 additions
and
0 deletions
libswresample/swresample.c
+
10
−
0
View file @
f9e55c0f
...
...
@@ -97,6 +97,8 @@ static const AVOption options[]={
,
OFFSET
(
soft_compensation_duration
),
AV_OPT_TYPE_FLOAT
,{.
dbl
=
1
},
0
,
INT_MAX
,
PARAM
},
{
"max_soft_comp"
,
"set maximum factor by which data is stretched/squeezed to make it match the timestamps."
,
OFFSET
(
max_soft_compensation
),
AV_OPT_TYPE_FLOAT
,{.
dbl
=
0
},
INT_MIN
,
INT_MAX
,
PARAM
},
{
"async"
,
"simplified 1 parameter audio timestamp matching, 0(disabled), 1(filling and trimming), >1(maximum stretch/squeeze in samples per second)"
,
OFFSET
(
async
)
,
AV_OPT_TYPE_FLOAT
,{.
dbl
=
0
},
INT_MIN
,
INT_MAX
,
PARAM
},
{
"matrix_encoding"
,
"set matrixed stereo encoding"
,
OFFSET
(
matrix_encoding
),
AV_OPT_TYPE_INT
,{.
i64
=
AV_MATRIX_ENCODING_NONE
},
AV_MATRIX_ENCODING_NONE
,
AV_MATRIX_ENCODING_NB
-
1
,
PARAM
,
"matrix_encoding"
},
{
"none"
,
"select none"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_MATRIX_ENCODING_NONE
},
INT_MIN
,
INT_MAX
,
PARAM
,
"matrix_encoding"
},
...
...
@@ -278,6 +280,14 @@ av_cold int swr_init(struct SwrContext *s){
set_audiodata_fmt
(
&
s
->
in
,
s
->
in_sample_fmt
);
set_audiodata_fmt
(
&
s
->
out
,
s
->
out_sample_fmt
);
if
(
s
->
async
)
{
if
(
s
->
min_compensation
>=
FLT_MAX
/
2
)
s
->
min_compensation
=
0
.
001
;
if
(
s
->
async
>
1
.
0001
)
{
s
->
max_soft_compensation
=
s
->
async
/
(
double
)
s
->
in_sample_rate
;
}
}
if
(
s
->
out_sample_rate
!=
s
->
in_sample_rate
||
(
s
->
flags
&
SWR_FLAG_RESAMPLE
)){
s
->
resample
=
s
->
resampler
->
init
(
s
->
resample
,
s
->
out_sample_rate
,
s
->
in_sample_rate
,
s
->
filter_size
,
s
->
phase_shift
,
s
->
linear_interp
,
s
->
cutoff
,
s
->
int_sample_fmt
,
s
->
filter_type
,
s
->
kaiser_beta
,
s
->
precision
,
s
->
cheby
);
}
else
...
...
This diff is collapsed.
Click to expand it.
libswresample/swresample_internal.h
+
1
−
0
View file @
f9e55c0f
...
...
@@ -84,6 +84,7 @@ struct SwrContext {
float
min_hard_compensation
;
///< minimum below which no silence inject / sample drop will happen
float
soft_compensation_duration
;
///< duration over which soft compensation is applied
float
max_soft_compensation
;
///< maximum soft compensation in seconds over soft_compensation_duration
float
async
;
///< simple 1 parameter async, similar to ffmpegs -async
int
resample_first
;
///< 1 if resampling must come first, 0 if rematrixing
int
rematrix
;
///< flag to indicate if rematrixing is needed (basically if input and output layouts mismatch)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment