From 37ac43847eddc42f51e348a81c73bb1b42481ad0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Nov 2019 19:07:55 +0100 Subject: options: pre-check filter names when using vf/af libavfilter bridge Until now, using a filter not in mpv's builtin filter list would assume it's a libavfilter filter. If it wasn't, the option value was still accepted, but creating the filter simply failed. But since this happens after option parsing, so the result is confusing. Improve this slightly by checking filter names. This will reject truly unknown filters at option parsing time. Unfortunately, this still does not check filter arguments. This would be much more complex, because you'd have to create a dummy filter graph and allocate the filter. Maybe another time. --- options/m_option.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'options/m_option.h') diff --git a/options/m_option.h b/options/m_option.h index 4289fa5a2e..a5f9618462 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -149,6 +149,9 @@ 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; + // Callback to test whether an unknown entry should be allowed. (This can + // be useful if adding them as explicit entries is too much work.) + bool (*check_unknown_entry)(const char *name); // Allow syntax for disabling entries. bool allow_disable_entries; // This helps with confusing error messages if unknown flag options are used. -- cgit v1.2.3