obs-studio/libobs/audio-monitoring
Hector Martin a5d08e347e linux-pulseaudio: fix race conditions
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.
2020-12-12 12:05:12 -08:00
..
null libobs: Add Pulseaudio audio monitoring support 2017-09-12 03:37:54 -07:00
osx clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
pulse linux-pulseaudio: fix race conditions 2020-12-12 12:05:12 -08:00
win32 libobs: Implement and use better scaling function for 64-bit integers 2020-04-05 20:27:28 +02:00