summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-02 02:26:55 +0200
committerwm4 <wm4@nowhere>2012-08-02 02:37:00 +0200
commitc7a15ed0ddf56b80a962a6aeb5da7981472ceaf2 (patch)
tree58ab8b6dcd25dfdf7e5f1aad4ea8cf818206d01e
parent16c6e1dee98b049c17fd262742839c0fde3ce7ed (diff)
downloadmpv-c7a15ed0ddf56b80a962a6aeb5da7981472ceaf2.tar.bz2
mpv-c7a15ed0ddf56b80a962a6aeb5da7981472ceaf2.tar.xz
m_config: reallow specifying static default values for string options
Commit dc2a4863af9b0e 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.
-rw-r--r--m_config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/m_config.c b/m_config.c
index 5b8dc77ba7..8181ddac37 100644
--- a/m_config.c
+++ b/m_config.c
@@ -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