audioaggregator: Make access to the pad list thread-safe while mixing
authorSebastian Dröge <sebastian@centricular.com>
Thu, 19 Oct 2023 16:41:27 +0000 (19:41 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 25 Oct 2023 13:58:06 +0000 (14:58 +0100)
commit8419c1e6dc63c15d9b2a0992cebf8cc93d7a2fba
treea1f58ce9b89a5d5158805d150c77b8c0b564ae26
parent970eb963c7c7b914c7109239d652d8ee0c3f114d
audioaggregator: Make access to the pad list thread-safe while mixing

When mixing every single buffer the object lock is shortly released and
acquired again. In the meantime the pad list can become invalid because
a pad was removed or added, and equally the current pad might as well
have been finalized in the meantime.

To get around that, take a snapshot of all sinkpads before mixing and
work with that list of pads.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3052

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5553>
subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioaggregator.c