player: only coalesce callbacks from parsed config files

This relaxes what bbac628a1b introduced.
Although it is rare, there may be scripts out there that depend on the
old timing. We'd still like to process config files in a sane manner and
not cause OOMs so keep the general coalescing mechanism in place but use
it selectively. There is one special case with the --input-commands
option. We want this coalesced as well so some special handling needs to
be added for that.
This commit is contained in:
Dudemanguy
2025-03-04 12:23:06 -06:00
parent f152674246
commit 533a684381
7 changed files with 30 additions and 5 deletions

View File

@@ -737,6 +737,9 @@ int m_config_set_option_cli(struct m_config *config, struct bstr name,
param = bstr0("no");
}
if (flags & M_SETOPT_FROM_CONFIG_FILE)
co->coalesce = true;
// This is the only mandatory function
mp_assert(co->opt->type->parse);

View File

@@ -49,6 +49,7 @@ struct m_config_option {
bool is_set_from_config : 1; // Set by a config file
bool is_set_locally : 1; // Has a backup entry
bool warning_was_printed : 1;
bool coalesce : 1; // Property changes should be coalesced
int32_t opt_id; // For some m_config APIs
const char *name; // Full name (ie option-subopt)
const struct m_option *opt; // Option description

View File

@@ -147,6 +147,8 @@ struct m_property {
void *priv;
// Special-case: mark options for which command.c uses the option-bridge
bool is_option;
// Special-case: option-bridge properties should be coalesced
bool coalesce;
};
struct m_property *m_property_list_find(const struct m_property *list,