summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-22 23:06:22 +0200
committerwm4 <wm4@nowhere>2013-07-22 23:07:23 +0200
commit78ebb3c6fa637206bb369349ba93328b36895e2b (patch)
tree94e3d1542c60dc03456fd7ffbb56921d28cf1660
parentf32a90a8396136cdded09390b68c9aac3d29ee7e (diff)
downloadmpv-78ebb3c6fa637206bb369349ba93328b36895e2b.tar.bz2
mpv-78ebb3c6fa637206bb369349ba93328b36895e2b.tar.xz
options: make legacy hacks for AFs/VFs more explicit
This means that AOs/VOs with no options set do not take the legacy option parsing path, but instead report that they have no options.
-rw-r--r--audio/filter/af.c1
-rw-r--r--core/m_option.c2
-rw-r--r--core/m_option.h2
-rw-r--r--video/filter/vf.c1
4 files changed, 5 insertions, 1 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c
index 26ca78c24f..3737228ddf 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -109,6 +109,7 @@ static bool get_desc(struct m_obj_desc *dst, int index)
const struct m_obj_list af_obj_list = {
.get_desc = get_desc,
.description = "audio filters",
+ .legacy_hacks = true, // many filters have custom option parsing
};
static bool af_config_equals(struct mp_audio *a, struct mp_audio *b)
diff --git a/core/m_option.c b/core/m_option.c
index 4ee8ba97ad..02258416ec 100644
--- a/core/m_option.c
+++ b/core/m_option.c
@@ -2140,7 +2140,7 @@ static int parse_obj_settings(struct bstr opt, struct bstr *pstr,
}
if (has_param) {
- if (!desc.options) {
+ if (!desc.options && list->legacy_hacks) {
// Should perhaps be parsed as escape-able string. But this is a
// compatibility path, so it's not worth the trouble.
int next = bstrcspn(*pstr, ",");
diff --git a/core/m_option.h b/core/m_option.h
index 73f3fabee8..9cd5202b90 100644
--- a/core/m_option.h
+++ b/core/m_option.h
@@ -125,6 +125,8 @@ struct m_obj_list {
// Allow unknown entries, for which a dummy entry is inserted, and whose
// options are skipped and ignored.
bool allow_unknown_entries;
+ // If object has no options set, assume it parses options on its own.
+ bool legacy_hacks;
};
// Find entry by name
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 5d2b9b8431..c6c3766baf 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -135,6 +135,7 @@ static bool get_desc(struct m_obj_desc *dst, int index)
const struct m_obj_list vf_obj_list = {
.get_desc = get_desc,
.description = "video filters",
+ .legacy_hacks = true, // some filters have custom option parsing
};
int vf_control(struct vf_instance *vf, int cmd, void *arg)