Remove lastNotifyTime throttle. Could ignore last device notification.
Will bring back if necessary, but seemed like overkill.
Make isInputDevice const for safety.
Make isDefaultDevice atomic. Allows it to be accessed simultaneously
from settings and notification callback threads. Race between setting
change in OBS and Windows is not a problem, a signal will be sent after
both to consolidate. Worst that should happen is a redundant reconnect
cycle.
Only read/write default_id from notification callback for thread safety.
Do not store IAudioClient and IAudioCaptureClient onto the source object
until initialization is almost complete, right before the capture thread
is created. We don't to retain objects from failed attempts. Also clear
them when stopping.
The previous monitor recovery logic touches the source monitoring type,
resets the monitor even if the output device hasn't been invalidated,
and was susceptible to races. Monitor invalidation should live within
the monitor abstraction.
Avoid nanosecond abstraction to reduce math operations.
Replace Sleep(0) with YieldProcessor(). We want the thread to remain
scheduled, the current CPU core to do less work, and the hyperthread
sibling to perform better.
Hacky profiling showed maybe 10-25 µs skid reduction per function call.
I think power/performance gains would be hard to measure, so I haven't
tried, but it would be shocking if they got worse.
When a profile changes settings that require a restart, show a dialog to
ask the user whether they'd like to restart.
Co-authored-by: Jim <obs.jim@gmail.com>
Closesobsproject/obs-studio#3207
Adds a new setting to the general OBS settings, which can be checked
in order to no longer show the "confirm close" dialog when there are
still streams/recordings running.
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
This reverts commit f832d14220b572165bf69ad73f30a5b961d02258.
Reverting this until we do more investigation. Currently, any text
that can be typed in a dialog requires the dialog to re-enable hotkeys
on destruction, which is frustrating. There has to be a better way.
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