diff options
authorwm4 <wm4@nowhere>2019-11-25 01:16:03 +0100
committerwm4 <wm4@nowhere>2019-11-25 01:16:03 +0100
commit13afc2150beeb1117e9c1724b2910e41ee4cc28b (patch)
parentf5daae12ff600b1c109d66efeca5e18176089b90 (diff)
command: change af/vf property behavior wrt. filter creation failures
The behavior is slightly different in a messy way. The change is in line with the option-to-property bridge removal mentioned some commits ago and thus is deemed necessary.
3 files changed, 19 insertions, 12 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst
index 0e9ca4998a..a33bfd8be2 100644
--- a/DOCS/interface-changes.rst
+++ b/DOCS/interface-changes.rst
@@ -47,6 +47,10 @@ Interface changes
property now is unavailable if no VO exists (or the VO did not return a
display FPS), instead of returning the option value in this case. The
property will keep existing, but writing to it is deprecated.
+ - the vf/af properties now do not reject the set value anymore, even if
+ filter chain initialization fails. Instead, the vf/af options are always
+ set to the user's value, even if it does not reflect the "runtime" vf/af
+ chain.
--- mpv 0.30.0 ---
- add `--d3d11-output-format` to enable explicit selection of a D3D11
swap chain format.
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index a098de99e2..ced5363ea1 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -2708,12 +2708,13 @@ caveats with some properties (due to historical reasons):
``vf``, ``af``
If you set the properties during playback, and the filter chain fails to
- reinitialize, the new value will be rejected. Setting the option or
- setting the property outside of playback will always succeed/fail in the
- same way. Also, there are no ``vf-add`` etc. properties, but you can use
- the ``vf``/``af`` group of commands to achieve the same.
+ reinitialize, the option will be set, but the runtime filter chain does not
+ change. On the other hand, the next video to be played will fail, because
+ the initial filter chain cannot be created.
- Option changes at runtime are affected by this as well.
+ This behavior changed in mpv 0.31.0. Before this, the new value was rejected
+ *iff* video (for ``vf``) or audio (for ``af``) was active. If playback was
+ not active, the behavior was the same as the current behavior.
While a file is loaded, the property will always return the effective
@@ -2726,7 +2727,8 @@ caveats with some properties (due to historical reasons):
uses, you should use the ``loadlist`` command instead.
- Might verify the set value when setting while a window is created.
+ Returns the current window values if a window exists, and the option value
+ otherwise.
``profile``, ``include``
These are write-only, and will perform actions as they are written to,
diff --git a/player/command.c b/player/command.c
index e7471e47fd..74db80e7b9 100644
--- a/player/command.c
+++ b/player/command.c
@@ -2989,17 +2989,12 @@ static char *print_obj_osd_list(struct m_obj_settings *list)
static int property_filter(struct m_property *prop, int action, void *arg,
MPContext *mpctx, enum stream_type mt)
- switch (action) {
+ if (action == M_PROPERTY_PRINT) {
struct m_config_option *opt = m_config_get_co(mpctx->mconfig,
*(char **)arg = print_obj_osd_list(*(struct m_obj_settings **)opt->data);
- return set_filters(mpctx, mt, *(struct m_obj_settings **)arg) >= 0
- }
return mp_property_generic_option(mpctx, prop, action, arg);
@@ -6314,6 +6309,12 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags)
if (opt_ptr == &opts->record_file)
open_recorder(mpctx, false);
+ if (opt_ptr == &opts->vf_settings)
+ set_filters(mpctx, STREAM_VIDEO, opts->vf_settings);
+ if (opt_ptr == &opts->af_settings)
+ set_filters(mpctx, STREAM_AUDIO, opts->af_settings);
void mp_notify_property(struct MPContext *mpctx, const char *property)