Apparently, some audio filters do not check the audio channel/plane
count, and instead check to see if a pointer is valid. Instead of
requiring the caller to initialize these values to 0 manually (they
shouldn't have to), set them to zero upon input in
obs_source_output_audio() itself.
Closesobsproject/obs-studio#3744
This reverts commit 1df278997883512e40b853dc3651ef31de0ec9c3.
This causes new sources to have their default mixer value overriden,
reverting until a more ideal fix is approved
Fixes a bug where if an audio source's implementation disappears (i.e.
a plugin vanishes or is removed), it would turn all mixing channels off,
effectively muting the source
Previously darray macros did not test the types of arguments so that
developers cannot notice even if a wrong type of a variable is passed.
This commit add a type test that relys on GCC's extension. Since OBS
Studio is built with GCC for Ubuntu, testing only under GCC is
sufficient to catch future bugs.
Currently, libobs contains two inhibitors: the portal-based one, and the
regular one based on each desktop environment's session manager. The portal
inhibitor takes precedence over the session manager one, when available.
Like the session manager inhibitor, the portal inhibitor performs all D-Bus
calls synchronously in the calling thread, which can lead to stalls. This is
not a good practice.
Make the portal inhibitor asynchronous, by using g_dbus_connection_call()
instead of g_dbus_connection_call_sync(). If an uninhibit call is made
before the previous inhibit call finishes, cancel the inhibit call instead.
Fixesobsproject/obs-studio#5314
There are some cases where an item may attempt to be created for a
removed source.
Previously, items created from removed sources would lead to the item
itself being saved, but the underlying source not being saved. While
this does not break OBS immediately, it means that the source along
with all associated items will disappear on OBS reload.
This prevents the item from being created in the first place, reducing
the chances of user work being lost.
66c27c2ceaa65 (#4664) was mistakenly merged. It was also the incorrect
way to fix the deadlock. Because duplicate_item_data() already defers
the texture creation process, we can just add a param to
obs_scene_add_internal() which allows us to exclude the creation of the
item texture for this specific case. The texture will then automatically
be created later before it's used. There was no reason to be creating
the texture there, as it was unnecessary.
Properly fixesobsproject/obs-studio#3166
There is a new toolchain called ARM64EC on MSVC which allows linking x64 objects to ARM64 objects.
It defines multiple architecture preprocessor definition including but not limited to `_M_X64`, `_M_ARM64` and `_M_ARM64EC`.
The original implementation will fail if compiling to ARM64EC.
As logic in video render thread, gs lock (obs_enter_graphics) should be requested before full_lock(scene).
However in function obs_sceneitem_group_ungroup called from UI thread, the order for requesting locks are contrary.
These defs inadvertently redefinine `std::strtoll` in C++ code
that includes the header, causing lots of problems. They only
serve to provide compatability with very old MSVC versions.
As such, they can just be removed entirely.
Fixes a long-standing issue with Dynamic Bitrate where the RTMP output
thread could try to reconfigure an encoder while the encoder is in the
middle of encoding. x264 seems to handle multithreaded calls well, but
NVENC would deadlock in this situation with no error visible to the
user.
These local copies of CheckForPthreads.c and FindThreads.cmake override
the ones included with CMake. These versions create CMake::Threads, but
Qt6 expects Threads::Threads created by CMake 3.1+. These local versions
seem to be based on old copies from CMake from late 2014 with some
customizations. Let's just use the built-in ones that CMake ships.
This commit also changes CMakeLists.txt files in UI and libobs to
require and link to Threads::Threads.
Co-authored-by: Kurt Kartaltepe <kkartaltepe@gmail.com>
Since the darray `sys_include_dirs` is an array of `char *`, it is
required to take a pointer to `char *`, that is `char **`. However,
`char *` was passed.
Since this function never called, another fix is removing entire
function `cf_preprocessor_add_sys_include_dir`.
This fixes a crash that could occur during freeing of sources, as the
audio subsystem was destroyed before sources were released. If a source
had monitoring enabled, it would try to lock a mutex that has been
destroyed, resulting in a crash.
Freeing audio after obs_free_data was also not a solution, as the main
view is freed in obs_free_data, and the audio subsystem is still running
and trying to lock the main view channel mutex which has been freed.
This seems to be the best middle ground, making sure the audio subsystem
is stopped so it no longer tries to access the main view channel, then
freed after obs_free_data.
Fixes https://github.com/obsproject/obs-studio/issues/4409
When playing video, OBS can overflow and crash, or render video edges
incorrectly if the video resolution does not divide into 2 for trivial
chroma subsampling. This is fixed by rounding chroma plane sizes up
instead of down, and maintaining that through the video pipeline.