mirror of https://github.com/mpv-player/mpv
m_config: reallow specifying static default values for string options
Commit dc2a4863af
introduced a new way of specifying default values
for strings (you're supposed to use OPTDEF_STR() instead of putting it
into the option struct, such as it was done in defaultopts.c). The code
to handle the old way was explicitly disabled, which caused random
crashes when used.
Allow the old way again. With the main option struct in particular, I
see no reason why some option defaults should be specified in
defaultopts.c, and some directly along the options.
This commit is contained in:
parent
16c6e1dee9
commit
c7a15ed0dd
|
@ -333,7 +333,7 @@ static void m_config_add_option(struct m_config *config,
|
|||
// Target data in optstruct is supposed to be cleared (consider
|
||||
// m_option freeing previously set dynamic data).
|
||||
optstruct_set(config, arg, arg->defval);
|
||||
} else if (!arg->new && (arg->type->flags & M_OPT_TYPE_DYNAMIC)) {
|
||||
} else if (arg->type->flags & M_OPT_TYPE_DYNAMIC) {
|
||||
// Initialize dynamically managed fields from static data (like
|
||||
// string options): copy the option into temporary memory,
|
||||
// clear the original option (to void m_option freeing the
|
||||
|
|
Loading…
Reference in New Issue