From 4b32d51b962bc1950a7efeacdcfce5c45716bb67 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 21 Apr 2018 13:18:03 +0200 Subject: f_output_chain: log status of auto filters Just so users don't think the filters do anything when they don't insert any filters. --- filters/f_output_chain.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'filters/f_output_chain.c') diff --git a/filters/f_output_chain.c b/filters/f_output_chain.c index 00d5e75faf..3b96f4a0a5 100644 --- a/filters/f_output_chain.c +++ b/filters/f_output_chain.c @@ -66,6 +66,8 @@ struct mp_user_filter { struct mp_image_params last_in_vformat; struct mp_aframe *last_in_aformat; + bool last_is_active; + int64_t last_in_pts, last_out_pts; bool failed; @@ -198,6 +200,13 @@ static void process_user(struct mp_filter *f) u->last_out_pts = pts; mp_pin_in_write(f->ppins[1], frame); + + struct mp_filter_command cmd = {.type = MP_FILTER_COMMAND_IS_ACTIVE}; + if (mp_filter_command(u->f, &cmd) && u->last_is_active != cmd.is_active) { + u->last_is_active = cmd.is_active; + MP_VERBOSE(p, "[%s] (%sabled)\n", u->name, + u->last_is_active ? "en" : "dis"); + } } } @@ -236,6 +245,7 @@ static struct mp_user_filter *create_wrapper_filter(struct chain *p) wrapper->wrapper = f; wrapper->p = p; wrapper->last_in_aformat = talloc_steal(wrapper, mp_aframe_create()); + wrapper->last_is_active = true; mp_filter_add_pin(f, MP_PIN_IN, "in"); mp_filter_add_pin(f, MP_PIN_OUT, "out"); return wrapper; -- cgit v1.2.3