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
b7e085a2
Commit
b7e085a2
authored
Dec 18, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
af_apad: add user setable packet_size
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5eae7f8f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
af_apad.c
libavfilter/af_apad.c
+25
-1
No files found.
libavfilter/af_apad.c
View file @
b7e085a2
...
...
@@ -36,15 +36,38 @@
#include "internal.h"
typedef
struct
{
const
AVClass
*
class
;
int64_t
next_pts
;
int
packet_size
;
}
APadContext
;
#define OFFSET(x) offsetof(APadContext, x)
#define A AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static
const
AVOption
apad_options
[]
=
{
{
"packet_size"
,
"set silence packet size"
,
OFFSET
(
packet_size
),
AV_OPT_TYPE_INT
,
{
.
i64
=
4096
},
0
,
INT_MAX
,
A
},
{
NULL
},
};
AVFILTER_DEFINE_CLASS
(
apad
);
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
int
ret
;
APadContext
*
apad
=
ctx
->
priv
;
apad
->
class
=
&
apad_class
;
apad
->
next_pts
=
AV_NOPTS_VALUE
;
av_opt_set_defaults
(
apad
);
if
((
ret
=
av_opt_set_from_string
(
apad
,
args
,
NULL
,
"="
,
":"
))
<
0
)
return
ret
;
av_opt_free
(
apad
);
return
0
;
}
...
...
@@ -65,7 +88,7 @@ static int request_frame(AVFilterLink *outlink)
ret
=
ff_request_frame
(
ctx
->
inputs
[
0
]);
if
(
ret
==
AVERROR_EOF
)
{
int
n_out
=
4096
;
int
n_out
=
apad
->
packet_size
;
AVFilterBufferRef
*
outsamplesref
=
ff_get_audio_buffer
(
outlink
,
AV_PERM_WRITE
,
n_out
);
if
(
!
outsamplesref
)
return
AVERROR
(
ENOMEM
);
...
...
@@ -113,4 +136,5 @@ AVFilter avfilter_af_apad = {
.
priv_size
=
sizeof
(
APadContext
),
.
inputs
=
apad_inputs
,
.
outputs
=
apad_outputs
,
.
priv_class
=
&
apad_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