Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
1d7d8244
Commit
1d7d8244
authored
Sep 30, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_rubberband: add process_command()
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
562ba4a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
af_rubberband.c
libavfilter/af_rubberband.c
+33
-0
No files found.
libavfilter/af_rubberband.c
View file @
1d7d8244
...
...
@@ -207,6 +207,38 @@ static int request_frame(AVFilterLink *outlink)
return
ret
;
}
static
int
process_command
(
AVFilterContext
*
ctx
,
const
char
*
cmd
,
const
char
*
args
,
char
*
res
,
int
res_len
,
int
flags
)
{
RubberBandContext
*
s
=
ctx
->
priv
;
if
(
!
strcmp
(
cmd
,
"tempo"
))
{
double
arg
;
sscanf
(
args
,
"%lf"
,
&
arg
);
if
(
arg
<
0
.
01
||
arg
>
100
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Tempo scale factor '%f' out of range
\n
"
,
arg
);
return
AVERROR
(
EINVAL
);
}
rubberband_set_time_ratio
(
s
->
rbs
,
1
.
/
arg
);
}
if
(
!
strcmp
(
cmd
,
"pitch"
))
{
double
arg
;
sscanf
(
args
,
"%lf"
,
&
arg
);
if
(
arg
<
0
.
01
||
arg
>
100
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Pitch scale factor '%f' out of range
\n
"
,
arg
);
return
AVERROR
(
EINVAL
);
}
rubberband_set_pitch_scale
(
s
->
rbs
,
arg
);
}
return
0
;
}
static
const
AVFilterPad
rubberband_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -235,4 +267,5 @@ AVFilter ff_af_rubberband = {
.
uninit
=
uninit
,
.
inputs
=
rubberband_inputs
,
.
outputs
=
rubberband_outputs
,
.
process_command
=
process_command
,
};
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