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
ce764a6c
Commit
ce764a6c
authored
Oct 09, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_atempo: use ff_filter_process_command()
parent
015cbca4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
17 deletions
+8
-17
af_atempo.c
libavfilter/af_atempo.c
+8
-17
No files found.
libavfilter/af_atempo.c
View file @
ce764a6c
...
@@ -162,7 +162,7 @@ static const AVOption atempo_options[] = {
...
@@ -162,7 +162,7 @@ static const AVOption atempo_options[] = {
OFFSET
(
tempo
),
AV_OPT_TYPE_DOUBLE
,
{
.
dbl
=
1
.
0
},
OFFSET
(
tempo
),
AV_OPT_TYPE_DOUBLE
,
{
.
dbl
=
1
.
0
},
YAE_ATEMPO_MIN
,
YAE_ATEMPO_MIN
,
YAE_ATEMPO_MAX
,
YAE_ATEMPO_MAX
,
AV_OPT_FLAG_AUDIO_PARAM
|
AV_OPT_FLAG_FILTERING_PARAM
},
AV_OPT_FLAG_AUDIO_PARAM
|
AV_OPT_FLAG_FILTERING_PARAM
|
AV_OPT_FLAG_RUNTIME_PARAM
},
{
NULL
}
{
NULL
}
};
};
...
@@ -328,28 +328,14 @@ static int yae_reset(ATempoContext *atempo,
...
@@ -328,28 +328,14 @@ static int yae_reset(ATempoContext *atempo,
return
0
;
return
0
;
}
}
static
int
yae_
set_tempo
(
AVFilterContext
*
ctx
,
const
char
*
arg_tempo
)
static
int
yae_
update
(
AVFilterContext
*
ctx
)
{
{
const
AudioFragment
*
prev
;
const
AudioFragment
*
prev
;
ATempoContext
*
atempo
=
ctx
->
priv
;
ATempoContext
*
atempo
=
ctx
->
priv
;
char
*
tail
=
NULL
;
double
tempo
=
av_strtod
(
arg_tempo
,
&
tail
);
if
(
tail
&&
*
tail
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid tempo value '%s'
\n
"
,
arg_tempo
);
return
AVERROR
(
EINVAL
);
}
if
(
tempo
<
YAE_ATEMPO_MIN
||
tempo
>
YAE_ATEMPO_MAX
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Tempo value %f exceeds [%f, %f] range
\n
"
,
tempo
,
YAE_ATEMPO_MIN
,
YAE_ATEMPO_MAX
);
return
AVERROR
(
EINVAL
);
}
prev
=
yae_prev_frag
(
atempo
);
prev
=
yae_prev_frag
(
atempo
);
atempo
->
origin
[
0
]
=
prev
->
position
[
0
]
+
atempo
->
window
/
2
;
atempo
->
origin
[
0
]
=
prev
->
position
[
0
]
+
atempo
->
window
/
2
;
atempo
->
origin
[
1
]
=
prev
->
position
[
1
]
+
atempo
->
window
/
2
;
atempo
->
origin
[
1
]
=
prev
->
position
[
1
]
+
atempo
->
window
/
2
;
atempo
->
tempo
=
tempo
;
return
0
;
return
0
;
}
}
...
@@ -1189,7 +1175,12 @@ static int process_command(AVFilterContext *ctx,
...
@@ -1189,7 +1175,12 @@ static int process_command(AVFilterContext *ctx,
int
res_len
,
int
res_len
,
int
flags
)
int
flags
)
{
{
return
!
strcmp
(
cmd
,
"tempo"
)
?
yae_set_tempo
(
ctx
,
arg
)
:
AVERROR
(
ENOSYS
);
int
ret
=
ff_filter_process_command
(
ctx
,
cmd
,
arg
,
res
,
res_len
,
flags
);
if
(
ret
<
0
)
return
ret
;
return
yae_update
(
ctx
);
}
}
static
const
AVFilterPad
atempo_inputs
[]
=
{
static
const
AVFilterPad
atempo_inputs
[]
=
{
...
...
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