Copying the encoder list takes a while which blocks the main thread.
Doing the copying asynchronously removes instead of blocking the main
thread improves startup performance by about 60ms.
If an user exits the source tree edit mode, without changing the name,
the scene item would become undraggable until the scene is refreshed.
We were setting the focus to just the label, not the whole widget.
Qt 6.2 introduced an issue where SingleSelection item views would
deselect the current item if the user clicked on empty area in the
widget.
This was very confusing in the scene tree as it was now possible to
unselect the current scene. A workaround for this in OBS was added in
08e4ee6 and expanded on in dc30cf0, but being quite hacky it never was
the perfect solution.
I since dug into Qt and fixed the issue upstream in qt/qtbase@f11e5435c7
for Qt 6.4.3 and newer, so we can remove the workaround when using those
versions (with the long term goal of removing the code altogether).
In some cases, `QToolbar::widgetForAction` may return `nullptr`. This
causes a crash on affected system.
To mitigate this, we check for `widgetForAction` result and skip
operating on a NULL widget.
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.
The aac spec has a list of default channel layouts that are implemented
by all aac encoders / decoders.
Unfortunately 2.1 is not in that list. When I wrote the surround sound
support into OBS, as a workaround I decided to encode 2.1 as
AV_CH_LAYOUT_SURROUND = FL+FR+FC.
The LFE channel is encoded as a regular audio channel which uses more
bits but this allows compatibility with all aac decoders.
Recently we updated to the new channel layout API of FFmpeg, but the
mapping of 2.1 to AV_CH_LAYOUT_SURROUND was forgotten in the FFmpeg
native aac encoder. This is remedied here.
Signed-off-by: pkv <pkv@obsproject.com>
The `srt_bstats()` function is not guaranteed to zero the stats object
before filling in stats. If a socket was connected, then disconnected,
without any data being sent over it, the stats object would remain
uninitialized, and weird results could occur.
If a scene or group is selected, disable the properties button in the
source toolbar. This also does a refactor of the function to enable/disable
the toolbar buttons.
The gain should be positive for an upward compressor. Initially, the
gain would be zeroe'd below -60 dB to ensure noise is not amplified by
the upward compressor. This created a discontinuity at -60 dB since
just above -60 dB, the audio is boosted by +20 dB (at default
settings). This was fixed in commit 50db097 which decreased smoothly
the gain so that it's 0 dB at -60 dB. However that commit forgot to
limit the gain decrease which was negative below -60 dB.
This is fixed by the current commit.
Additionally initialization allowed -inf gain. We hard limit to positive
gains only as they should be for an upward compressor.
The bugfix was found by R1ch and put in form by pkv.
Co-authored-by: pkv <pkv@obsproject.com>
Signed-off-by: pkv <pkv@obsproject.com>
Makes macOS aware that we're using either light or dark theme to adjust
native dialog colors accordingly.
Co-Authored-By: Patrick Heyer <PatTheMav@users.noreply.github.com>
Hides the following items if source is only audio:
- Transform menu
- Resize output (size of source)
- Scale filter menu
- Blending mode menus
- Projector menus
- Screenshots
- Interact