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
b5314333
Commit
b5314333
authored
Aug 11, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_adelay: make it possible to delay channels by exact number of samples
parent
0ed5c3ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
filters.texi
doc/filters.texi
+8
-0
af_adelay.c
libavfilter/af_adelay.c
+8
-2
No files found.
doc/filters.texi
View file @
b5314333
...
...
@@ -513,6 +513,7 @@ Set list of delays in milliseconds for each channel separated by '|'.
At least one delay greater than 0 should be provided.
Unused delays will be silently ignored. If number of given delays is
smaller than number of channels all remaining channels will not be delayed.
If you want to delay exact number of samples, append 'S' to number.
@end table
@subsection Examples
...
...
@@ -524,6 +525,13 @@ the second channel (and any other channels that may be present) unchanged.
@example
adelay=1500|0|500
@end example
@item
Delay second channel by 500 samples, the third channel by 700 samples and leave
the first channel (and any other channels that may be present) unchanged.
@example
adelay=0|500S|700S
@end example
@end itemize
@section aecho
...
...
libavfilter/af_adelay.c
View file @
b5314333
...
...
@@ -138,14 +138,20 @@ static int config_input(AVFilterLink *inlink)
for
(
i
=
0
;
i
<
s
->
nb_delays
;
i
++
)
{
ChanDelay
*
d
=
&
s
->
chandelay
[
i
];
float
delay
;
char
type
=
0
;
int
ret
;
if
(
!
(
arg
=
av_strtok
(
p
,
"|"
,
&
saveptr
)))
break
;
p
=
NULL
;
sscanf
(
arg
,
"%f"
,
&
delay
);
d
->
delay
=
delay
*
inlink
->
sample_rate
/
1000
.
0
;
ret
=
sscanf
(
arg
,
"%d%c"
,
&
d
->
delay
,
&
type
);
if
(
ret
!=
2
||
type
!=
'S'
)
{
sscanf
(
arg
,
"%f"
,
&
delay
);
d
->
delay
=
delay
*
inlink
->
sample_rate
/
1000
.
0
;
}
if
(
d
->
delay
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Delay must be non negative number.
\n
"
);
return
AVERROR
(
EINVAL
);
...
...
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