urisourcebin: Avoid deadlock on shutdown
authorEdward Hervey <edward@centricular.com>
Mon, 16 Dec 2024 15:36:06 +0000 (16:36 +0100)
committerBackport Bot <gitlab-backport-bot@gstreamer-foundation.org>
Fri, 20 Dec 2024 11:10:17 +0000 (11:10 +0000)
commit3158c6c71f417368bc82d0ba591269baa8850e40
treeb073a8d7cfb0fdb6891999b440cdbd47c3f41ffd
parent5fc72f071f405941f847e2e23c43d5f153d7762d
urisourcebin: Avoid deadlock on shutdown

The reason why the STATE lock was taken was to avoid issues where we would be
adding (and activating) elements at the same time as urisourcebin would be
brought down to READY. That would cause those new elements to potentially return
ERRORS because of not-negotiated/flushing-pads

But that creates a really bad deadlock (state lock is taken to deactivate the
streaming thread which .. is currently grabbing the state lock).

Instead, we can just ignore the warning/error messages that might occur when
shutting down.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8187>
subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c