docs: Clarify obs_source_update can accept NULL for settings argument #11189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the parameter description of the API
obs_source_update
.Also fixed a gramatical error;
will be not be called
-->will not be called
.Motivation and Context
In the implementation,
settings
can be NULL and it will be just ignored if it is NULL.obs-studio/libobs/obs-source.c
Lines 990 to 992 in 15e9242
Passing NULL as the
settings
argument is useful to triggerupdate
callback.I realized AJA source calls
obs_source_update
with the existingsettings
. This is redundant, we can just passNULL
.https://github.com/obsproject/obs-studio/blob/master/plugins/aja/aja-source.cpp#L327
How Has This Been Tested?
OS: Fedora 39
Called
obs_source_update
with the NULL argument and confirmed the settings was not changed.Types of changes
Checklist:
Sidenote:
When passing a valid
obs_data_t
object, elements that exists in the current settings but does not exist in the passed object are not removed.This is because
obs_source_update
traverse each element in the givenobs_data_t
object and apply it to the current settings.It would be good for the document to describe this behavior. However, I don't have a good idea to phrase this in concise sentence.