summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward.hervey@collabora.co.uk>2011-02-24 12:50:01 +0100
committerEdward Hervey <edward.hervey@collabora.co.uk>2011-02-28 18:00:06 +0100
commit56dd890dcaa17ea8522770709435882c8826df4c (patch)
treecd560c35d73349e2d6ef013470c1896b5eded7f8
parentb77cd7cf8cfa569b5fafa456f41cf830d14ce700 (diff)
gnloperation: Handle the cases where the sink pads disappear
-rw-r--r--gnl/gnloperation.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gnl/gnloperation.c b/gnl/gnloperation.c
index e13a44e..4a7bbad 100644
--- a/gnl/gnloperation.c
+++ b/gnl/gnloperation.c
@@ -686,12 +686,14 @@ remove_sink_pad (GnlOperation * operation, GstPad * sinkpad)
if (sinkpad) {
GstPad *target = gst_ghost_pad_get_target ((GstGhostPad *) sinkpad);
- /* release the target pad */
- gnl_object_ghost_pad_set_target ((GnlObject *) operation, sinkpad, NULL);
- gst_element_release_request_pad (operation->element, target);
+ if (target) {
+ /* release the target pad */
+ gnl_object_ghost_pad_set_target ((GnlObject *) operation, sinkpad, NULL);
+ gst_element_release_request_pad (operation->element, target);
+ gst_object_unref (target);
+ }
operation->sinks = g_list_remove (operation->sinks, sinkpad);
gnl_object_remove_ghost_pad ((GnlObject *) operation, sinkpad);
- gst_object_unref (target);
operation->realsinks--;
}