If the recording path is left empty in Settings, a leak can occur in
window-basic-stats.cpp because a bmalloc is called for a size 1.
This fixes the leak by checking against the path in the
os_get_free_disk_space function.
Signed-off-by: pkv <pkv@obsproject.com>
It was possible to set the encoder to scale the video to the same size
as the output, resulting in unnecessary passes through swscale and
skipping hardware encoders. This was a common user error in Advanced
Output mode where they would tick the rescale box but leave it at the
same resolution as their main output.
By adding the range data we can get successful handling of full range
color via custom FFmpeg output. Previously it would always default to 0
which would yield partial/limited output. Without the colorspace info
the output file is correctly tagged, but not undergone the actual
conversion.
Also modifies libobs & deps/media-playback.
AV_CODEC_CAP_TRUNCATED was removed in avcodec 60 [1].
We ifdef the code depending on it to allow compilation.
[1] avcodec: remove FF_API_FLAG_TRUNCATED
3ceffe7839
Signed-off-by: pkv <pkv@obsproject.com>
As clang and gcc use "default" visibility (as in "not hidden") when
no visibility is specified, all functions are implicitly exported.
When changing default visibility to "hidden", the corresponding symbols
are not exposed anymore and linking fails. This PR updates all
functions signatures that were added in recent commits but not set to
be EXPORTed.
Also makes required OpenGL imports for texture sharing on macOS
mandatory.
When the `pos` variable is non-zero, audio does not get mixed correctly.
This is due to the fact that the `pos` variable was erroneously being
applied to the input rather than the output.
This makes multiple changes to resolve issues with monitoring. We have
added a number of things over time to resolve various issues due to our
misunderstanding of the pulse api and the explicitly wrong pulse api
documentation.
First is removing the prior stream write tracking. Write tracking
was incorrect as pulse sends you the total number of bytes it wants
written at that time and not a incremental, but also this write tracking
is unhelpful since we can just let begin_write signal when we should
stop writing.
Second removing underflow tracking, this sort of worked to detect high
latency sources like vlc which buffer ~1s of data before writing audio
data. It worked because it would grow the buffer in PA until we could
write enough data into it, but it didn't allow us to leverage that
larger buffer because we never paused the PA stream.
To solve the buffering/high latency issue instead start the PA stream
corked and only uncork it once we have enough data to reach the targeted
latency. We also check how much data we recieve from the source and if
it appears to be high latency providing us with much more data than our
target latency we increase the latency to match the source. Fixing the
VLC source issue and resulting in a smooth start to audio instead of
underruns while we play and increase latency.
Finally add some handling for pulses incorrectly documented API. Notably
that begin_write may request more or less data from you so handle both
cases. And stop attempting to use attr.maxlength which is not updated
after set_buffer_attr calls and was always -1, and tlength is just more
appropriate.
old mantis resulting in some changes, still fixed. https://obsproject.com/mantis/view.php?id=1076fixes#7574
New video formats introduced for ProRes 4444 encoding have not been
implemented in function calls used for video decoding, which makes the
switch statements non-exhaustive.
This does not functionally change the status quo (decoding ProRes 4444
files could still be broken because libobs does not explicitly handle
the colour format).
When a variable `pos` became larger than `AUDIO_OUTPUT_FRAMES`, `count`
will get overflowed number. To avoid the overflow, continue the loop
when `AUDIO_OUTPUT_FRAMES - pos` is not positive.
Currently, the X11 display is leaked when the X11 hotkey
platform is destroyed. Fix that by calling XCloseDisplay()
to free it.
Fixes: bcb04bb800 ("libobs: Open a separate X11 connection for hotkeys")
Previously, `custom_size` was checked at the end of the `scene_load`
function. If the scene contained no "items" array, the `custom_scene`
loading code would never be run.
This moves the `custom_size` code above the return statement.
There was quite a bit of conflated usage of mixes (which refers
to raw audio) and encoder counts. This fully separates the two
and makes a distinct separation when iterating over mixes vs
encoders.
OBS has been logging `1 views remain at shutdown` when in reality there
are not technically any views remaining. When views are removed, the
view itself is destroyed immediately, but the mix remains, to be
garbage collected by the graphics thread.
In this case, the view has already been removed, but the graphics
thread has not run an interation and cleaned up the mix, so this
log message appears.
Fixes the issue by checking if a mix actually has an assigned view,
instead of blindly logging existing mixes.
There is currently no way to clear a video_t or audio_t object from an
encoder once applied. `audio_t`/`video_t` objects can be destructed at
any time, and it is dangerous to prevent these object references from
even being cleared.
This does not fix the issue where destroying an audio/video object does
not clear the reference from all subscribed encoders.
Protect `obs_encoder_set_video()` and `obs_encoder_set_audio()` from
being used if the encoder is active. Changing these values while active
is undefined behavior.