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
16d91b7e
Commit
16d91b7e
authored
Nov 09, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_afir: kill useless code which increases latency for no reason
parent
07bc6037
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
34 deletions
+9
-34
af_afir.c
libavfilter/af_afir.c
+9
-32
af_afir.h
libavfilter/af_afir.h
+0
-2
No files found.
libavfilter/af_afir.c
View file @
16d91b7e
...
...
@@ -120,16 +120,13 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink)
{
AVFilterContext
*
ctx
=
outlink
->
src
;
AVFrame
*
out
=
NULL
;
int
ret
;
s
->
nb_samples
=
in
->
nb_samples
;
if
(
!
s
->
want_skip
)
{
out
=
ff_get_audio_buffer
(
outlink
,
s
->
nb_samples
);
if
(
!
out
)
{
av_frame_free
(
&
in
);
return
AVERROR
(
ENOMEM
);
}
out
=
ff_get_audio_buffer
(
outlink
,
s
->
nb_samples
);
if
(
!
out
)
{
av_frame_free
(
&
in
);
return
AVERROR
(
ENOMEM
);
}
if
(
s
->
pts
==
AV_NOPTS_VALUE
)
...
...
@@ -139,11 +136,9 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink)
s
->
part_index
=
(
s
->
part_index
+
1
)
%
s
->
nb_partitions
;
if
(
!
s
->
want_skip
)
{
out
->
pts
=
s
->
pts
;
if
(
s
->
pts
!=
AV_NOPTS_VALUE
)
s
->
pts
+=
av_rescale_q
(
out
->
nb_samples
,
(
AVRational
){
1
,
outlink
->
sample_rate
},
outlink
->
time_base
);
}
out
->
pts
=
s
->
pts
;
if
(
s
->
pts
!=
AV_NOPTS_VALUE
)
s
->
pts
+=
av_rescale_q
(
out
->
nb_samples
,
(
AVRational
){
1
,
outlink
->
sample_rate
},
outlink
->
time_base
);
s
->
index
++
;
if
(
s
->
index
==
3
)
...
...
@@ -152,14 +147,7 @@ static int fir_frame(AudioFIRContext *s, AVFrame *in, AVFilterLink *outlink)
av_frame_free
(
&
in
);
s
->
in
[
0
]
=
NULL
;
if
(
s
->
want_skip
==
1
)
{
s
->
want_skip
=
0
;
ret
=
0
;
}
else
{
ret
=
ff_filter_frame
(
outlink
,
out
);
}
return
ret
;
return
ff_filter_frame
(
outlink
,
out
);
}
static
void
drawtext
(
AVFrame
*
pic
,
int
x
,
int
y
,
const
char
*
txt
,
uint32_t
color
)
...
...
@@ -496,16 +484,7 @@ static int activate(AVFilterContext *ctx)
return
ret
;
}
if
(
s
->
need_padding
)
{
in
=
ff_get_audio_buffer
(
outlink
,
s
->
part_size
);
if
(
!
in
)
return
AVERROR
(
ENOMEM
);
s
->
need_padding
=
0
;
ret
=
1
;
}
else
{
ret
=
ff_inlink_consume_samples
(
ctx
->
inputs
[
0
],
s
->
part_size
,
s
->
part_size
,
&
in
);
}
ret
=
ff_inlink_consume_samples
(
ctx
->
inputs
[
0
],
s
->
part_size
,
s
->
part_size
,
&
in
);
if
(
ret
>
0
)
ret
=
fir_frame
(
s
,
in
,
outlink
);
...
...
@@ -626,8 +605,6 @@ static int config_output(AVFilterLink *outlink)
s
->
nb_channels
=
outlink
->
channels
;
s
->
nb_coef_channels
=
ctx
->
inputs
[
1
]
->
channels
;
s
->
want_skip
=
1
;
s
->
need_padding
=
1
;
s
->
pts
=
AV_NOPTS_VALUE
;
return
0
;
...
...
libavfilter/af_afir.h
View file @
16d91b7e
...
...
@@ -66,8 +66,6 @@ typedef struct AudioFIRContext {
int
nb_coef_channels
;
int
one2many
;
int
nb_samples
;
int
want_skip
;
int
need_padding
;
RDFTContext
**
rdft
,
**
irdft
;
float
**
sum
;
...
...
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