Existing code didn't check for possible "empty" linked libraries
(e.g. Threads::Threads when compiler has built-in pthreads support).
Also adds support for compile options defined on linked dependencies.
malloc(0) is implementation defined and almost always a mistake. I
believe we should be more like malloc and treat bmalloc(0) as an error
instead of tying to handle it. For now we can log an error in case 3rd
party plugins are broken, in the future I would suggest this becomes a
crash-worthy error.
Hopefully nothing is actually using this in the first place. As a
library libobs has alignment requirements so we should probably not
allow an application to replace our aligned mallocs with something else.
This also allows more aggressive optimizations inside libobs as the call
can be completely inlined into a libc malloc.
- Changes the default base exponent value to 1.5 from 2.0
- Applies a random skew of +-0.05 to the exponent to lessen the
"water hammer" effect caused by predictable backoff techniques
- Fixes the logging associated with exponential backoff to log the
true reconnect delay value
Due to a bug in shader parsing, it thinks that because the token
"multiplier" is used here, that the "multiplier" uniform is being used.
This is a workaround for the issue because fixing the parser is probably
going to be much more annoying than just working around the issue for
now.
In bb6787968, we changed the default behaviour to be strict modifiers
and we consider this to be the correct way. There is no need to change
this from code either, since if someone really needs non-strict
modifiers, they can work around it by setting multiple hotkeys.
Having this option in code just means a bigger maintenance cost, so
we'll deprecate the function and remove it in the future.
If obs_core_hotkeys.strict_modifiers is true (new default),
hotkey is triggered only if current key modifiers exactly match
the hotkey definition. If false, legacy behavior is selected.
Adds %s which replaces the keyword with the current unix epoch time.
The %s keyword is common in languages like PHP and Python, and even
some C implementations, but it is not standard so this is a fallback.
However the hotkeys can be configured with right-side modifiers in UI,
the right modifiers did not work when hitting the hot keys.
This is because `query_hotkeys` in `obs-hotkey.c` was querying states of
only left modifiers.
Only warn when the pointer provided to obs_source_release() is
non-NULL. In some custom usages of libobs, libobs may be freed before
OBS* smart pointers (like OBSSource) are destructed, leading to a
misleading warning if the pointers have already been cleared with
nullptr.
Previous behavior is basically:
- Clear OBS* pointers with nullptr
- Unload libobs
- Those smart pointers that were cleared will still call
obs_source_release() on destruct
- Warning appears
Add comparison check so that NaN is caught.
Comparisons with NaN always result in false.
NaNs cause problems later in audio encoder.
Note: may break with -ffast-math compiler flag.
Fixes#4885.
Since [1], avcodec/version.h is not included anymore in codec.h and
therefore is not included any more in avformat.h.
As a result, LIBAVCODEC_VERSION_INT is no longer defined. This commit
fixes the include.
Since obviously we can't ifdef the avcodec include by referring to an
avcodec version, we ifdef it with the avformat version which was bumped
at the same time [2].
[1] libavcodec: Split version.h
f2da2e1458
[2] doc: Add an entry to APIchanges about changes to version.h and
version_major.h
f3a0e2ee2b
Signed-off-by: pkv <pkv@obsproject.com>
Prior to this change, the audio thread roughly waits the time of
`AUDIO_OUTPUT_FRAMES`, and consecutively processes twice or more if the
latency is accumulated. This behavior causes fluctuation of timing to
output audio packets. This change introduces `os_sleepto_ns_fast` so
that the audio packets will be periodically output.
The function `os_sleepto_ns` has a spin loop so it will consume CPU
resource. The new function has same interface but consumes less CPU
resource with a drawback of less precision.
Fixes studio mode preview on SDR monitor for HDR canvas rendering SDR
source into SDR swap chain. Needs to render SDR source into HDR render
target, and then tonemap into SDR swap chain for preview.