mpegtsmux: Make handling of sinkpads thread-safe
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Wed, 2 Sep 2020 13:29:49 +0000 (15:29 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 9 Sep 2020 02:25:40 +0000 (02:25 +0000)
commit66f9d37c37bd655b423686b51bdf3c7d7956ced2
treefa484144273b013d857c7bb9cab8aa838bf05df4
parent3f9a7e5c7313991294101654d43091438a9a2387
mpegtsmux: Make handling of sinkpads thread-safe

Ensure we take the object lock while accessing `GstElement.sinkpads`.
Use an iterator when the code isn't simple to avoid deadlock.

When we find the best pad, take a reference so a concurrent pad
release doesn't destroy the pad before we're done with it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1553>
gst/mpegtsmux/gstbasetsmux.c
gst/mpegtsmux/gstbasetsmux.h