From 7305140a8ade58847d9e44cf4ebf5fd202b30892 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Sun, 13 Apr 2014 07:52:58 -0700 Subject: vf: auto-label video filters if no label is specified Signed-off-by: wm4 --- video/filter/vf.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'video/filter') diff --git a/video/filter/vf.c b/video/filter/vf.c index 2e26ed0fbe..a37afde68b 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -307,8 +307,19 @@ int vf_append_filter_list(struct vf_chain *c, struct m_obj_settings *list) struct vf_instance *vf = vf_append_filter(c, list[n].name, list[n].attribs); if (vf) { - if (list[n].label) + if (list[n].label) { vf->label = talloc_strdup(vf, list[n].label); + } else { + for (int i = 0; i < 100; i++) { + char* label = talloc_asprintf(vf, "%s.%02d", list[n].name, i); + if (vf_find_by_label(c, label)) { + talloc_free(label); + } else { + vf->label = label; + break; + } + } + } } } return 0; -- cgit v1.2.3