base: 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:39:05 +0000 (17:39 +0200)
commite7bf5484c7c5fb97318cc58a0902d4ddd5ae459c
tree67fa4f600869ea1d063884e1c09b10032090d3fc
parent7dd38cdcf40dc740dfea3eb4fdc166f3780aca73
base: 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.
libs/gst/base/gstbasesink.c
libs/gst/base/gstbasetransform.c