summaryrefslogtreecommitdiffstats
path: root/audio/filter
diff options
context:
space:
mode:
authornanahi <130121847+na-na-hi@users.noreply.github.com>2024-04-10 01:47:05 -0400
committerKacper Michajłow <kasper93@gmail.com>2024-04-10 19:00:22 +0200
commit9bb7d96bf969f1bba3211c4eb802f8a6c391c392 (patch)
treef73037a64b5dca8163b16e0f5fe97425eefd84a4 /audio/filter
parent06f88dfb3a86e5d037d885319fbf93fc46d95371 (diff)
downloadmpv-9bb7d96bf969f1bba3211c4eb802f8a6c391c392.tar.bz2
mpv-9bb7d96bf969f1bba3211c4eb802f8a6c391c392.tar.xz
various: make filter internal function names more descriptive
Lots of filters have generic internal function names like "process". On a stack trace, all of the different filters use this name, which causes confusion of the actual filter being processed. This renames these internal function names to carry the filter names. This matches what had already been done for some filters.
Diffstat (limited to 'audio/filter')
-rw-r--r--audio/filter/af_drop.c18
-rw-r--r--audio/filter/af_format.c4
-rw-r--r--audio/filter/af_lavcac3enc.c14
-rw-r--r--audio/filter/af_rubberband.c16
-rw-r--r--audio/filter/af_scaletempo.c16
-rw-r--r--audio/filter/af_scaletempo2.c18
6 files changed, 43 insertions, 43 deletions
diff --git a/audio/filter/af_drop.c b/audio/filter/af_drop.c
index 724c482720..499389dd2b 100644
--- a/audio/filter/af_drop.c
+++ b/audio/filter/af_drop.c
@@ -11,7 +11,7 @@ struct priv {
struct mp_aframe *last; // for repeating
};
-static void process(struct mp_filter *f)
+static void af_drop_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@@ -52,7 +52,7 @@ static void process(struct mp_filter *f)
mp_pin_in_write(f->ppins[1], frame);
}
-static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
+static bool af_drop_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *p = f->priv;
@@ -65,7 +65,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
-static void reset(struct mp_filter *f)
+static void af_drop_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
@@ -73,18 +73,18 @@ static void reset(struct mp_filter *f)
p->diff = 0;
}
-static void destroy(struct mp_filter *f)
+static void af_drop_destroy(struct mp_filter *f)
{
- reset(f);
+ af_drop_reset(f);
}
static const struct mp_filter_info af_drop_filter = {
.name = "drop",
.priv_size = sizeof(struct priv),
- .process = process,
- .command = command,
- .reset = reset,
- .destroy = destroy,
+ .process = af_drop_process,
+ .command = af_drop_command,
+ .reset = af_drop_reset,
+ .destroy = af_drop_destroy,
};
static struct mp_filter *af_drop_create(struct mp_filter *parent, void *options)
diff --git a/audio/filter/af_format.c b/audio/filter/af_format.c
index 2d1c1cc97d..eddce6422f 100644
--- a/audio/filter/af_format.c
+++ b/audio/filter/af_format.c
@@ -38,7 +38,7 @@ struct priv {
struct mp_pin *in_pin;
};
-static void process(struct mp_filter *f)
+static void af_format_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@@ -85,7 +85,7 @@ error:
static const struct mp_filter_info af_format_filter = {
.name = "format",
.priv_size = sizeof(struct priv),
- .process = process,
+ .process = af_format_process,
};
static struct mp_filter *af_format_create(struct mp_filter *parent,
diff --git a/audio/filter/af_lavcac3enc.c b/audio/filter/af_lavcac3enc.c
index ec3330f17b..def9700d18 100644
--- a/audio/filter/af_lavcac3enc.c
+++ b/audio/filter/af_lavcac3enc.c
@@ -139,18 +139,18 @@ static bool reinit(struct mp_filter *f)
return true;
}
-static void reset(struct mp_filter *f)
+static void af_lavcac3enc_reset(struct mp_filter *f)
{
struct priv *s = f->priv;
TA_FREEP(&s->in_frame);
}
-static void destroy(struct mp_filter *f)
+static void af_lavcac3enc_destroy(struct mp_filter *f)
{
struct priv *s = f->priv;
- reset(f);
+ af_lavcac3enc_reset(f);
av_packet_free(&s->lavc_pkt);
avcodec_free_context(&s->lavc_actx);
}
@@ -161,7 +161,7 @@ static void swap_16(uint16_t *ptr, size_t size)
ptr[n] = av_bswap16(ptr[n]);
}
-static void process(struct mp_filter *f)
+static void af_lavcac3enc_process(struct mp_filter *f)
{
struct priv *s = f->priv;
@@ -281,9 +281,9 @@ error:
static const struct mp_filter_info af_lavcac3enc_filter = {
.name = "lavcac3enc",
.priv_size = sizeof(struct priv),
- .process = process,
- .reset = reset,
- .destroy = destroy,
+ .process = af_lavcac3enc_process,
+ .reset = af_lavcac3enc_reset,
+ .destroy = af_lavcac3enc_destroy,
};
static void add_chmaps_to_autoconv(struct mp_filter *f,
diff --git a/audio/filter/af_rubberband.c b/audio/filter/af_rubberband.c
index 48e5cc1e86..e71937fcb2 100644
--- a/audio/filter/af_rubberband.c
+++ b/audio/filter/af_rubberband.c
@@ -105,7 +105,7 @@ static bool init_rubberband(struct mp_filter *f)
return true;
}
-static void process(struct mp_filter *f)
+static void af_rubberband_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@@ -233,7 +233,7 @@ error:
mp_filter_internal_mark_failed(f);
}
-static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
+static bool af_rubberband_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *p = f->priv;
@@ -263,7 +263,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
-static void reset(struct mp_filter *f)
+static void af_rubberband_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
@@ -274,7 +274,7 @@ static void reset(struct mp_filter *f)
TA_FREEP(&p->pending);
}
-static void destroy(struct mp_filter *f)
+static void af_rubberband_destroy(struct mp_filter *f)
{
struct priv *p = f->priv;
@@ -286,10 +286,10 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info af_rubberband_filter = {
.name = "rubberband",
.priv_size = sizeof(struct priv),
- .process = process,
- .command = command,
- .reset = reset,
- .destroy = destroy,
+ .process = af_rubberband_process,
+ .command = af_rubberband_command,
+ .reset = af_rubberband_reset,
+ .destroy = af_rubberband_destroy,
};
static struct mp_filter *af_rubberband_create(struct mp_filter *parent,
diff --git a/audio/filter/af_scaletempo.c b/audio/filter/af_scaletempo.c
index f06478f750..e7b101b260 100644
--- a/audio/filter/af_scaletempo.c
+++ b/audio/filter/af_scaletempo.c
@@ -229,7 +229,7 @@ static void output_overlap_s16(struct priv *s, void *buf_out,
}
}
-static void process(struct mp_filter *f)
+static void af_scaletempo_process(struct mp_filter *f)
{
struct priv *s = f->priv;
@@ -511,7 +511,7 @@ static bool reinit(struct mp_filter *f)
return true;
}
-static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
+static bool af_scaletempo_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *s = f->priv;
@@ -530,7 +530,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
-static void reset(struct mp_filter *f)
+static void af_scaletempo_reset(struct mp_filter *f)
{
struct priv *s = f->priv;
@@ -543,7 +543,7 @@ static void reset(struct mp_filter *f)
TA_FREEP(&s->in);
}
-static void destroy(struct mp_filter *f)
+static void af_scaletempo_destroy(struct mp_filter *f)
{
struct priv *s = f->priv;
free(s->buf_queue);
@@ -558,10 +558,10 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info af_scaletempo_filter = {
.name = "scaletempo",
.priv_size = sizeof(struct priv),
- .process = process,
- .command = command,
- .reset = reset,
- .destroy = destroy,
+ .process = af_scaletempo_process,
+ .command = af_scaletempo_command,
+ .reset = af_scaletempo_reset,
+ .destroy = af_scaletempo_destroy,
};
static struct mp_filter *af_scaletempo_create(struct mp_filter *parent,
diff --git a/audio/filter/af_scaletempo2.c b/audio/filter/af_scaletempo2.c
index 7ad8e3566d..e43c29ac01 100644
--- a/audio/filter/af_scaletempo2.c
+++ b/audio/filter/af_scaletempo2.c
@@ -19,9 +19,9 @@ struct priv {
};
static bool init_scaletempo2(struct mp_filter *f);
-static void reset(struct mp_filter *f);
+static void af_scaletempo2_reset(struct mp_filter *f);
-static void process(struct mp_filter *f)
+static void af_scaletempo2_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@@ -156,7 +156,7 @@ static bool init_scaletempo2(struct mp_filter *f)
return true;
}
-static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
+static bool af_scaletempo2_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *p = f->priv;
@@ -169,7 +169,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
-static void reset(struct mp_filter *f)
+static void af_scaletempo2_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
mp_scaletempo2_reset(&p->data);
@@ -177,7 +177,7 @@ static void reset(struct mp_filter *f)
TA_FREEP(&p->pending);
}
-static void destroy(struct mp_filter *f)
+static void af_scaletempo2_destroy(struct mp_filter *f)
{
struct priv *p = f->priv;
mp_scaletempo2_destroy(&p->data);
@@ -187,10 +187,10 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info af_scaletempo2_filter = {
.name = "scaletempo2",
.priv_size = sizeof(struct priv),
- .process = process,
- .command = command,
- .reset = reset,
- .destroy = destroy,
+ .process = af_scaletempo2_process,
+ .command = af_scaletempo2_command,
+ .reset = af_scaletempo2_reset,
+ .destroy = af_scaletempo2_destroy,
};
static struct mp_filter *af_scaletempo2_create(