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
12a284fa
Commit
12a284fa
authored
Apr 29, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_rubberband: make use of initial input timestamp
parent
093a5044
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
af_rubberband.c
libavfilter/af_rubberband.c
+6
-1
No files found.
libavfilter/af_rubberband.c
View file @
12a284fa
...
...
@@ -37,6 +37,7 @@ typedef struct RubberBandContext {
smoothing
,
formant
,
opitch
,
channels
;
int64_t
nb_samples_out
;
int64_t
nb_samples_in
;
int64_t
first_pts
;
int
nb_samples
;
}
RubberBandContext
;
...
...
@@ -124,6 +125,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
AVFrame
*
out
;
int
ret
=
0
,
nb_samples
;
if
(
s
->
first_pts
==
AV_NOPTS_VALUE
)
s
->
first_pts
=
in
->
pts
;
rubberband_process
(
s
->
rbs
,
(
const
float
*
const
*
)
in
->
data
,
in
->
nb_samples
,
ff_outlink_get_status
(
inlink
));
s
->
nb_samples_in
+=
in
->
nb_samples
;
...
...
@@ -134,7 +138,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
av_frame_free
(
&
in
);
return
AVERROR
(
ENOMEM
);
}
out
->
pts
=
av_rescale_q
(
s
->
nb_samples_out
,
out
->
pts
=
s
->
first_pts
+
av_rescale_q
(
s
->
nb_samples_out
,
(
AVRational
){
1
,
outlink
->
sample_rate
},
outlink
->
time_base
);
nb_samples
=
rubberband_retrieve
(
s
->
rbs
,
(
float
*
const
*
)
out
->
data
,
nb_samples
);
...
...
@@ -162,6 +166,7 @@ static int config_input(AVFilterLink *inlink)
return
AVERROR
(
ENOMEM
);
s
->
nb_samples
=
rubberband_get_samples_required
(
s
->
rbs
);
s
->
first_pts
=
AV_NOPTS_VALUE
;
return
0
;
}
...
...
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