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
1c32d7df
Commit
1c32d7df
authored
Jun 06, 2020
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/asrc_anoisesrc: switch to activate
Allows to set EOF timestamp.
parent
49d37b4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
asrc_anoisesrc.c
libavfilter/asrc_anoisesrc.c
+9
-4
No files found.
libavfilter/asrc_anoisesrc.c
View file @
1c32d7df
...
...
@@ -21,6 +21,7 @@
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "internal.h"
#include "libavutil/lfg.h"
#include "libavutil/random_seed.h"
...
...
@@ -198,16 +199,20 @@ static av_cold int config_props(AVFilterLink *outlink)
return
0
;
}
static
int
request_frame
(
AVFilterLink
*
outlink
)
static
int
activate
(
AVFilterContext
*
ctx
)
{
AVFilter
Context
*
ctx
=
outlink
->
src
;
AVFilter
Link
*
outlink
=
ctx
->
outputs
[
0
]
;
ANoiseSrcContext
*
s
=
ctx
->
priv
;
AVFrame
*
frame
;
int
nb_samples
,
i
;
double
*
dst
;
if
(
!
ff_outlink_frame_wanted
(
outlink
))
return
FFERROR_NOT_READY
;
if
(
!
s
->
infinite
&&
s
->
duration
<=
0
)
{
return
AVERROR_EOF
;
ff_outlink_set_status
(
outlink
,
AVERROR_EOF
,
s
->
pts
);
return
0
;
}
else
if
(
!
s
->
infinite
&&
s
->
duration
<
s
->
nb_samples
)
{
nb_samples
=
s
->
duration
;
}
else
{
...
...
@@ -236,7 +241,6 @@ static const AVFilterPad anoisesrc_outputs[] = {
{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
request_frame
=
request_frame
,
.
config_props
=
config_props
,
},
{
NULL
}
...
...
@@ -248,6 +252,7 @@ AVFilter ff_asrc_anoisesrc = {
.
query_formats
=
query_formats
,
.
priv_size
=
sizeof
(
ANoiseSrcContext
),
.
inputs
=
NULL
,
.
activate
=
activate
,
.
outputs
=
anoisesrc_outputs
,
.
priv_class
=
&
anoisesrc_class
,
};
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