libobs: Fix bug where obs_data default might not be set
If a source is created with settings, default values would not be set on data items that already had values set. The check here was supposed to be a not equal rather than an equal because you're not supposed to be able to set a default value of one type on an item that already exists but is of a different type. This bug would make it so that if a particular setting was removed, there would be no default value to fall back on, and it would always be 0 or NULL for all values. It's likely this bug wasn't encountered until now because before now there had been no reason to clear or remove settings on most things.
This commit is contained in:
parent
b8d907f399
commit
9ab0f26214
@ -854,7 +854,7 @@ static inline void set_item_def(struct obs_data *data, obs_data_item_t **item,
|
||||
item = &actual_item;
|
||||
}
|
||||
|
||||
if (item && *item && (*item)->type == type)
|
||||
if (item && *item && (*item)->type != type)
|
||||
return;
|
||||
|
||||
set_item_data(data, item, name, ptr, size, type, true, false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user