command: fix unintended reset of filters

Since the recent option changes (probably b16cea750f), using the "vf"
or "af" commands to change the filter chain did not write the option
value correctly. This led to the option value being reset the next time
an option changed.

This happened because the new option value was not copied to the
m_config_cache's internal storage. So on the next option update, it
looked like the option value changed, because the user-side value was
different from the internal value. It was copied back, which meant the
original option value was reinstated, and the previous "vf"/"af" command
was undone.

Fix this by using the correct way to store the option value. This also
takes care of property change notification (because the function is
specifically separate from m_config_cache_write_opt() to do that), so
remove the old call.

Fixes: #7220
This commit is contained in:
wm4 2019-12-06 19:27:45 +01:00
parent b0c9f582ad
commit 23289a452f
1 changed files with 1 additions and 1 deletions

View File

@ -3777,7 +3777,7 @@ static int set_filters(struct MPContext *mpctx, enum stream_type mediatype,
if (success) {
m_option_free(co->opt, &old_settings);
mp_notify_property(mpctx, filter_opt[mediatype]);
m_config_notify_change_opt_ptr(mpctx->mconfig, list);
} else {
m_option_free(co->opt, list);
*list = old_settings;