ghostpad: 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:37:54 +0000 (17:37 +0200)
commit7dd38cdcf40dc740dfea3eb4fdc166f3780aca73
tree0a358c08cf41d8a5b786e580f6105f5b19774a11
parentb2e6870edc7824489f7c74789fba3ced60eb49e8
ghostpad: 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.
gst/gstghostpad.c