Skip to content

audio: Make sure to stop ringbuffer on error.

Jan Schmidt requested to merge thaytan/gstreamer:audiobasesrc-error-cleanly into main

Add gst_audio_ring_buffer_set_errored() that will mark the ringbuffer as errored only if it is currently started or paused, so gst_audio_ringbuffer_stop() can be sure that the error state means that the ringbuffer was started and needs stop called.

Fixes a crash with osxaudiosrc if the source element posts an error, because the ringbuffer would not get stopped and CoreAudio would continue trying to do callbacks.

Also, anywhere that modifies the ringbuffer state, make sure to use atomic operations, to guarantee their visibility

Merge request reports