summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-20 14:44:44 +0200
committerwm4 <wm4@nowhere>2015-09-20 14:44:44 +0200
commit21e5e4da4baa92fab9e830ec5a62bbccdea85cf0 (patch)
tree1086c8b4490b7318a8dfe69542883d4bb215461c
parentbad743aed5a8fd22742317c344f126f04a0392ca (diff)
downloadmpv-21e5e4da4baa92fab9e830ec5a62bbccdea85cf0.tar.bz2
mpv-21e5e4da4baa92fab9e830ec5a62bbccdea85cf0.tar.xz
audio/filter: remove reentrancy flag
This flag was used by some filters and made sure none of these filters were inserted twice. This triggers only if the user explicitly tries to add multiple filters (and not e.g. due to auto-insertion), so at best this warned the user from doing something potentially pointless. At worst, it blocked some (mildly) legitimate use-cases. Get rid of it. Also see #2322.
-rw-r--r--audio/filter/af.c15
-rw-r--r--audio/filter/af.h5
-rw-r--r--audio/filter/af_drc.c1
-rw-r--r--audio/filter/af_equalizer.c1
-rw-r--r--audio/filter/af_volume.c1
5 files changed, 1 insertions, 22 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c
index 3f73ad9c58..62ba6a9665 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -159,24 +159,11 @@ static struct af_instance *af_create(struct af_stream *s, char *name,
MP_ERR(s, "Couldn't find audio filter '%s'.\n", name);
return NULL;
}
- const struct af_info *info = desc.p;
- /* Make sure that the filter is not already in the list if it is
- non-reentrant */
- if (info->flags & AF_FLAGS_NOT_REENTRANT) {
- for (struct af_instance *cur = s->first; cur; cur = cur->next) {
- if (cur->info == info) {
- MP_ERR(s, "There can only be one "
- "instance of the filter '%s' in each stream\n", name);
- return NULL;
- }
- }
- }
-
MP_VERBOSE(s, "Adding filter %s \n", name);
struct af_instance *af = talloc_zero(NULL, struct af_instance);
*af = (struct af_instance) {
- .info = info,
+ .info = desc.p,
.data = talloc_zero(af, struct mp_audio),
.log = mp_log_new(af, s->log, name),
.replaygain_data = s->replaygain_data,
diff --git a/audio/filter/af.h b/audio/filter/af.h
index 199486509c..ba64379661 100644
--- a/audio/filter/af.h
+++ b/audio/filter/af.h
@@ -35,10 +35,6 @@ struct mpv_global;
// Number of channels
#define AF_NCH MP_NUM_CHANNELS
-// Flags used for defining the behavior of an audio filter
-#define AF_FLAGS_REENTRANT 0x00000000
-#define AF_FLAGS_NOT_REENTRANT 0x00000001
-
// Flags for af->filter()
#define AF_FILTER_FLAG_EOF 1
@@ -47,7 +43,6 @@ struct mpv_global;
struct af_info {
const char *info;
const char *name;
- const int flags;
int (*open)(struct af_instance *vf);
int priv_size;
const void *priv_defaults;
diff --git a/audio/filter/af_drc.c b/audio/filter/af_drc.c
index 472758c4c7..7b375febf4 100644
--- a/audio/filter/af_drc.c
+++ b/audio/filter/af_drc.c
@@ -324,7 +324,6 @@ static int af_open(struct af_instance* af){
const struct af_info af_info_drc = {
.info = "Dynamic range compression filter",
.name = "drc",
- .flags = AF_FLAGS_NOT_REENTRANT,
.open = af_open,
.priv_size = sizeof(af_drc_t),
.options = (const struct m_option[]) {
diff --git a/audio/filter/af_equalizer.c b/audio/filter/af_equalizer.c
index 781239c02a..cb4ecb2675 100644
--- a/audio/filter/af_equalizer.c
+++ b/audio/filter/af_equalizer.c
@@ -203,7 +203,6 @@ static int af_open(struct af_instance* af){
const struct af_info af_info_equalizer = {
.info = "Equalizer audio filter",
.name = "equalizer",
- .flags = AF_FLAGS_NOT_REENTRANT,
.open = af_open,
.priv_size = sizeof(af_equalizer_t),
.options = (const struct m_option[]) {
diff --git a/audio/filter/af_volume.c b/audio/filter/af_volume.c
index 1b564f0983..7bd7edd66d 100644
--- a/audio/filter/af_volume.c
+++ b/audio/filter/af_volume.c
@@ -168,7 +168,6 @@ static int af_open(struct af_instance *af)
const struct af_info af_info_volume = {
.info = "Volume control audio filter",
.name = "volume",
- .flags = AF_FLAGS_NOT_REENTRANT,
.open = af_open,
.priv_size = sizeof(struct priv),
.options = (const struct m_option[]) {