When an encoder was not created in create_encoder, the appropriate
OSStatus value is returned but the calling code expects a boolean
return value.
The negative OSStatus code sent on error is thus interpreted as a
truthy value and the error is not detected. Changing the call signature
to correctly return an OSStatus (and change the caller to detect
error situations) fixes this.
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.
This commit replaces usage of `av_stream_add_side_data(...)` with
`av_packet_side_data_add(...)`, as the former was deprecated in favor of
the latter.
The FFmpeg commit that deprecated `av_stream_add_side_data(...)` is [1].
The FFmpeg commit that introduced `av_packet_side_data_add(...)` is [2].
Note that the deprecation commit is after the new API function. The
commit in between [3] appears to be changes that migrates to the usage
of the new API function.
[1]: avformat/avformat: use the side data from AVStream.codecpar
5432d2aaca
[2]: avcodec/packet: add generic side data helpers
74279227dd
[3]: avcodec/codec_par: add side data to AVCodecParameters
21d7cc6fa9
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.
This commit prevents obs from using the "fenced" code if using FFmpeg
6.1, since in FFmpeg commit [1] the "side_data" is added to
`AVCodecParameters`, and therefore the existing/following
`avcodec_parameters_copy(...)` will account for the metadata.
[1]: avcodec/codec_par: add side data to AVCodecParameters
21d7cc6fa9
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.
AVFrame.key_frame was replaced with a flag in AVFrame.flags. The commit
adding the flag is [1] in FFmpeg's repository, and the deprecation is in
commit [2].
In summary of the "key_frame" change, AVFrame.key_frame is deprecated,
and AVFrame.flags indicates with a bit flag if it is a key frame (with
the enum/defined AV_FRAME_FLAG_KEY).
[1]: avutil/frame: add a keyframe flag to AVFrame
cc11191fda
[2]: avutil/frame: deprecate key_frame
3e06f6f040
Fixes for using FFmpeg 6.1 due to deprecations. Uses `#if` macros to
allow builds for using older versions of FFmpeg.
The change in deps/media-playback/media-playback/decode.c is due to
FFmpeg moving "side_data" into AVCodecParameters which is mentioned in
commit [1] in FFmpeg's repository.
In summary of the "side_data" change, AVStream.side_data is deprecated
and replaced with AVStream.codecpar->coded_side_data, and
AVStream.nb_side_data is replaced with
AVStream.codecpar->nb_coded_side_data.
[1]: avcodec/codec_par: add side data to AVCodecParameters
21d7cc6fa9
When using a PTS divisor, OBS would still increment the PTS by only the
original `fps_den` value, not considering that PTS values should be
multiplied by the divisor.
For example, `60/1` increases like `0,1,2,3`. `60000/1001` increases
like `0,1001,2002,3003`.
Without this fix, `60/1` main OBS framerate with a divisor of `2`
produces `0,1,2,3`, while the correct pattern would be `0,2,4,6`
Instead of a checkbox in the recording group that reveals the replay
buffer group when pressed, the replay buffer group now has its own
toggle that enables or disables the replay buffer.
If an output has already stopped, but its StopRecording function was
called again, then ffmpeg_mux_stop would be called and set stopping to
true. On the next output start, OBS would output 1 frame, see that
stopping is true, and then stop the output.
This was most easily observed using an Output Timer to record prior to
93f5b45be8.
Initialize stopping to false with the other state flags to ensure that
the output has a clean starting state.
While filters are saved using obs_save_source other mutex are used.
To prevent a deadlock, don't keep the filter mutex iterating the filters.
This fixes#9893
When running an Output Timer multiple times, multiple signal-slot
connections would be made with the corresponding output stop event
functions. This would cause later Output Timers to terminate
unexpectedly early, due to the stop functions having been called
repeatedly on previous Output Timer runs while outputs were stopping.
There may still be an underlying bug with calling stop on outputs
repeatedly, but this change at least ensures that Output Timers only
call their stop functions once.
A few reports came in of cache files with the correct size but full of
null bytes, presumably from a system crash and an SSD lying about buffer
flushes. This commit adds a checksum at the end of the compiled bytecode
so we don't try to use invalid data.
Co-Authored-By: derrod <dennis@obsproject.com>
Removes the internal helper `remove_without_release()` and branches
`obs_sceneitem_remove()` into public and internal versions.
The `obs_sceneitem_set_transition()` calls were missing from the
`remove_without_release()` function, so this resolves that issue
implicitly. Code cleanup mentioned above is done to hopefully avoid
these mistakes again.
Flag was added in CMake 2.0 update and is incompatible with incremental
linking enabled by default for Debug configuration (MSVC default).
The original error that necessitates adding LTCG is not present with
current obs-deps anymore, so remove it instead and disable the
hard-coded default library directive in Debug configuration.
Before the commit 763dddbbaf, hotkeys to show and hide scene items are
distinguished by source name instead of ID. When migrating from the
legacy data structure, the pointer to the data was not released.
An already-removed item has a NULL `item->parent`, meaning that calling
`full_lock(scene)` results in undefined behavior. This makes the method
return earlier if the specified item is removed instead of attempting
to lock the scene.
No thread safety is changed, because it wasn't thread-safe to begin
with.
We use a size_t that can be 64bit while EGL uses 32bit for the
underlying value. Writes from our graphics function can leave high bits
uninitialized and cause iteration of the format list to overlfow.
fixes#9844
CMake 3.25 changed the way PDB generation is handled by only enabling
it for Debug and RelWithDebInfo builds, which prohibits generation of
fully optimized builds with associated symbols (which is MSVC's
default).
If configuring with CMake 3.25 or above, enable this globally for builds
using MSVC and fall back to embedded debug information for anything else
(which would probably be clang-cl).
Validate the Flatpak manifest before building it; then, validate
the build directory; and when publishing, validate the repository
as well.
Using flatpak-builder-lint in the org.flatpak.Builder Flatpak in a
docker container seems to not work.
So the linter repo is cloned and Poetry is used to run it inside an
custom action.
"--exceptions" is required to allow the manifest to pass since
OBS Studio has one for "--talk-name=org.freedesktop.Flatpak".
Co-authored-by: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
This race condition is caused when one thread creates a swap chain,
which calls OBS_CreateSwapchainKHR, at the same time another thread
calls OBS_CreateImageView.
OBS_CreateSwapchainKHR allocates swap data, publishes this into the
data->swaps linked list, then initializes it. Meanwhile,
OBS_CreateImageView is iterating the swaps linked list, to see if the
image matches any swap chain images. Due to the order in
OBS_CreateSwapchainKHR, there's no guarantee this data is initialized
so it often ends up running out of bounds on the swap_images array.
The fix is simply to defer the swap data publish to after init.