For *_update, apply settings instead of replacing
Make it so obs_data settings input in to *_update are applied to the existing settings rather than fully replace the existing settings. That way you can update with only certain specific settings, leaving other settings untouched. Of course if you're already using the original settings pointer in the first place then you've already done that, so it'll just ignore it because you've already applied them.
This commit is contained in:
@@ -56,6 +56,8 @@ EXPORT void obs_data_release(obs_data_t data);
|
||||
|
||||
EXPORT const char *obs_data_getjson(obs_data_t data);
|
||||
|
||||
EXPORT void obs_data_apply(obs_data_t target, obs_data_t apply_data);
|
||||
|
||||
EXPORT void obs_data_erase(obs_data_t data, const char *name);
|
||||
|
||||
/* Set functions */
|
||||
@@ -150,18 +152,6 @@ static inline obs_data_t obs_data_newref(obs_data_t data)
|
||||
return data;
|
||||
}
|
||||
|
||||
static inline void obs_data_replace(obs_data_t *current, obs_data_t replacement)
|
||||
{
|
||||
if (!current)
|
||||
return;
|
||||
|
||||
if (*current != replacement) {
|
||||
replacement = obs_data_newref(replacement);
|
||||
obs_data_release(*current);
|
||||
*current = replacement;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user