summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Heinrich <christoph.heinrich@student.tugraz.at>2023-10-07 01:26:09 +0200
committerDudemanguy <random342@airmail.cc>2023-10-07 00:30:29 +0000
commitef4a5101289b485ceafdcad599329437bf411b93 (patch)
treea9b85bbcf6645e6e77719f16e9d19cb06441bc43
parent779888136018adcf058d8578fc596eabb55a52f4 (diff)
downloadmpv-ef4a5101289b485ceafdcad599329437bf411b93.tar.bz2
mpv-ef4a5101289b485ceafdcad599329437bf411b93.tar.xz
af_scaletempo: overlap is a factor not a percentage
-rw-r--r--DOCS/man/af.rst4
-rw-r--r--audio/filter/af_scaletempo.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/DOCS/man/af.rst b/DOCS/man/af.rst
index 3607ca44d8..d9c184e9c5 100644
--- a/DOCS/man/af.rst
+++ b/DOCS/man/af.rst
@@ -116,8 +116,8 @@ Available filters are:
cause noticeable skips at high scale amounts and an echo at low scale
amounts. Very low values will alter pitch. Increasing improves
performance. (default: 60)
- ``overlap=<percent>``
- Percentage of stride to overlap. Decreasing improves performance.
+ ``overlap=<factor>``
+ Factor of stride to overlap. Decreasing improves performance.
(default: .20)
``search=<amount>``
Length in milliseconds to search for best overlap position. Decreasing
diff --git a/audio/filter/af_scaletempo.c b/audio/filter/af_scaletempo.c
index 8675c9a50d..f06478f750 100644
--- a/audio/filter/af_scaletempo.c
+++ b/audio/filter/af_scaletempo.c
@@ -48,7 +48,7 @@ struct f_opts {
float scale_nominal;
float ms_stride;
float ms_search;
- float percent_overlap;
+ float factor_overlap;
#define SCALE_TEMPO 1
#define SCALE_PITCH 2
int speed_opt;
@@ -400,7 +400,7 @@ static bool reinit(struct mp_filter *f)
update_speed(s, s->speed);
- int frames_overlap = s->frames_stride * s->opts->percent_overlap;
+ int frames_overlap = s->frames_stride * s->opts->factor_overlap;
if (frames_overlap <= 0) {
s->bytes_standing = s->bytes_stride;
s->samples_standing = s->bytes_standing / bps;
@@ -604,7 +604,7 @@ const struct mp_user_filter_entry af_scaletempo = {
.priv_size = sizeof(OPT_BASE_STRUCT),
.priv_defaults = &(const OPT_BASE_STRUCT) {
.ms_stride = 60,
- .percent_overlap = .20,
+ .factor_overlap = .20,
.ms_search = 14,
.speed_opt = SCALE_TEMPO,
.scale_nominal = 1.0,
@@ -612,7 +612,7 @@ const struct mp_user_filter_entry af_scaletempo = {
.options = (const struct m_option[]) {
{"scale", OPT_FLOAT(scale_nominal), M_RANGE(0.01, DBL_MAX)},
{"stride", OPT_FLOAT(ms_stride), M_RANGE(0.01, DBL_MAX)},
- {"overlap", OPT_FLOAT(percent_overlap), M_RANGE(0, 1)},
+ {"overlap", OPT_FLOAT(factor_overlap), M_RANGE(0, 1)},
{"search", OPT_FLOAT(ms_search), M_RANGE(0, DBL_MAX)},
{"speed", OPT_CHOICE(speed_opt,
{"pitch", SCALE_PITCH},