Request / response latency dominates the download time of small
files and patches, especially the locale files. Increasing this to
4 doesn't consume many more resources and basically doubles the
download speed, especially on higher latency connections.
Unfortunately WinHTTP doesn't support multiplexing with HTTP2, but there
is still some minor benefit to enabling it. Windows 10 21H1 will enable
TLS 1.3 client support in Schannel, so let's get ready for it.
On a modern Windows OS, you can rename an in-use file despite not being
able to write to it. With the introduction of the virtual camera, it is
now quite common that users will have in-use files when updating. This
commit renames in-use files, allowing the new version to be installed.
Upon a reboot, the previously in-use file will be deleted.
With the queued connection in d68484e7, the "Deselect" signal for
sources which are being deleted is never fired, as the object is gone by
the time the queued signal is processed. This results in the context bar
not updating.
This commit adds a new UpdateContextBarDeferred function, allowing
queuing of only the context bar update instead of the whole signal
handler.
The previous calculation was completely broken, returning offset
timestamps in the best case, and complete insanity in the worst case
(e.g. if an xrun occurs or JACK otherwise has a glitch).
This lock causes a deadlock when freeing the JACK client while a
process callback is pending:
deactivate_jack -> locks mutex
JACK thread -> calls jack_process_callback
jack_process_callback -> blocks on mutex
jack_client_close -> joins JACK thread
(deadlock as the process callback never returns)
Instead, just don't lock the mutex. This is only mutexing on
creation/destruction of the JACK client. This is not necessary: the
process callback will only run after jack_activate (which is right
before the mutex is released in jack_init()), and will stop running
by the time jack_client_close returns. We don't actually need to
unregister any ports, so just call jack_client_close first thing in
deactivate_jack, which will guarantee the process callback has
completed before returning.
In fact, jack_process_callback isn't allowed to lock any mutexes or
allocate any memory at all, so this plug-in is still broken in this way
as obs_source_output_audio does that. This can cause audio xruns, as
realtime guarantees are violated. This is something that should be
fixed in the future, but at least it's not a deadlock.
PulseAudio code needs to be called with the PA lock held. This chiefly
fixes multiple races during stream shutdown:
* If the functions are called without the lock held, deferred event
handling races end up with PA infinite looping on the mainloop, or
asserting, or other badness, as the reentrant calls cause data
structure corruption on the PA side.
* If we don't reset our callbacks, PA might call us even after we
request stream disconnection (since the stream actually getting fully
shut down is asynchronous), and then we dereference NULL pointers from
our userdata etc. PA will keep its data structures alive until necessary
via reference counting, but not ours.
The lock around pa_stream_begin_write doesn't result from any issues I
experienced, but it looks correct; PA doesn't say anywhere that that
function is thread-safe.
If the user hasn't specifically set a rate control and left OBS at the
default of CBR, the settings loaded by GetDataFromJsonFile will not have
a rate_control parameter present. This causes the replay buffer to think
the user is in VBR mode and use the wrong settings for determining
maximum buffer size. Fixes#2516.
The (de)select signal can come from a obs_scene_enum_items
which locks the scene. The Qt::QueuedConnection makes sure
the (de)select is handled outside of that lock.
Fixes the deadlock from #3673
Regression introduced by dc4e20500: while the stop detection is pending,
it should still return false so the rest of the discard code can run.
Otherwise, the source audio will remain in the buffer, lagging the
source and triggering audio buffering increases until max audio
buffering is reached.
When /bin/sh isn't bash, the previous line always appears to succeed,
and modinfo's output is not redirected, because it actually runs
modinfo in the background (which always succeeds) then opens and closes
/dev/null without doing anything to it. This causes us to always think
that the v4l2loopback module is installed, even when it isn't.