summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-03-25 17:07:40 +0100
committerwm4 <wm4@nowhere>2017-03-25 17:07:40 +0100
commit7d424b4ce45534ade52f38df68308498decc0171 (patch)
treef5ed0a3c98cab67ce50e76a0223031cb73eb39b8 /video
parent29f9e44723104aac8ce91d0347a91fb206afba8d (diff)
downloadmpv-7d424b4ce45534ade52f38df68308498decc0171.tar.bz2
mpv-7d424b4ce45534ade52f38df68308498decc0171.tar.xz
command: add better runtime filter toggling method
Basically, see the example in input.rst. This is better than the "old" vf-toggle method, because it doesn't require the user to duplicate the filter string in mpv.conf and input.conf. Some aspects of this changes are untested, so enjoy your alpha testing.
Diffstat (limited to 'video')
-rw-r--r--video/filter/vf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 94e6760603..5208c7f824 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -128,6 +128,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",
+ .allow_disable_entries = true,
};
// Try the cmd on each filter (starting with the first), and stop at the first
@@ -322,6 +323,8 @@ struct vf_instance *vf_append_filter(struct vf_chain *c, const char *name,
int vf_append_filter_list(struct vf_chain *c, struct m_obj_settings *list)
{
for (int n = 0; list && list[n].name; n++) {
+ if (!list[n].enabled)
+ continue;
struct vf_instance *vf =
vf_append_filter(c, list[n].name, list[n].attribs);
if (vf) {