elements: Fix pad callbacks so they handle when parent goes away
authorOle André Vadla Ravnås <oravnas@cisco.com>
Thu, 6 Jan 2011 17:11:31 +0000 (18:11 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 13 Apr 2011 15:41:17 +0000 (17:41 +0200)
commit037efe87380022ad17b7a62d84eddee4fb68a917
tree1cb44f17af3a63badadc31209e0e1b6ab1010980
parente7bf5484c7c5fb97318cc58a0902d4ddd5ae459c
elements: Fix pad callbacks so they handle when parent goes away

1) We need to lock and get a strong ref to the parent, if still there.
2) If it has gone away, we need to handle that gracefully.

This is necessary in order to safely modify a running pipeline. Has been
observed when a streaming thread is doing a buffer_alloc() while an
application thread sends an event on a pad further downstream, and from
within a pad probe (holding STREAM_LOCK) carries out the pipeline plumbing
while the streaming thread has its buffer_alloc() in progress.
plugins/elements/gstfunnel.c
plugins/elements/gstinputselector.c
plugins/elements/gstoutputselector.c
plugins/elements/gstqueue.c
plugins/elements/gsttee.c