diff options
author | Edward Hervey <bilboed@bilboed.com> | 2009-06-12 18:43:51 +0200 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-06-12 18:52:48 +0200 |
commit | d9ec7f59f32f35f0ef09faaf6b9f8452da0d7275 (patch) | |
tree | 47594d23b9482fbba464ad9f727f3c01c9865838 | |
parent | 344a24557149e8383b1d39cdeff3791c8b2a4d5f (diff) |
gnlcomposition: Recheck for ghostpad existence in critical codepath.
-rw-r--r-- | gnl/gnlcomposition.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c index 8091e85..1ca338a 100644 --- a/gnl/gnlcomposition.c +++ b/gnl/gnlcomposition.c @@ -968,10 +968,10 @@ gnl_composition_event_handler (GstPad * ghostpad, GstEvent * event) /* FIXME : What should we do here if waitingpads != 0 ?? */ /* Delay ? Ignore ? Refuse ? */ - if (res) { + if (res && comp->private->ghostpad) { GST_DEBUG_OBJECT (comp, "About to call gnl_event_pad_func()"); COMP_OBJECTS_LOCK (comp); - res = comp->private->gnl_event_pad_func (ghostpad, event); + res = comp->private->gnl_event_pad_func (comp->private->ghostpad, event); COMP_OBJECTS_UNLOCK (comp); GST_DEBUG_OBJECT (comp, "Done calling gnl_event_pad_func() %d", res); } @@ -1005,10 +1005,12 @@ gnl_composition_ghost_pad_set_target (GnlComposition * comp, GstPad * target) /* Create new ghostpad */ comp->private->ghostpad = gnl_object_ghost_pad_no_target ((GnlObject *) comp, "src", GST_PAD_SRC); - GST_DEBUG_OBJECT (comp->private->ghostpad, - "About to replace event_pad_func"); - comp->private->gnl_event_pad_func = - GST_PAD_EVENTFUNC (comp->private->ghostpad); + if (!comp->private->gnl_event_pad_func) { + GST_DEBUG_OBJECT (comp->private->ghostpad, + "About to replace event_pad_func"); + comp->private->gnl_event_pad_func = + GST_PAD_EVENTFUNC (comp->private->ghostpad); + } gst_pad_set_event_function (comp->private->ghostpad, GST_DEBUG_FUNCPTR (gnl_composition_event_handler)); GST_DEBUG_OBJECT (comp->private->ghostpad, "eventfunc is now %s", |