summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2013-01-09 11:54:36 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2013-05-25 16:31:13 -0400
commitdc63dc9877b7ec2af36de36b28fa7308ca63ec11 (patch)
treeaebf3343a0cdd25a10cc9c57c57d623fef2362cf
parent5ec3038a252aa1d1a24d8284b773a16c455cc9dc (diff)
ghostpad: Correctly handle pad creation failure
We where trying to activate the pad even if creating the ghostpad failed. Instead, warn if that fails, and return NULL as expected.
-rw-r--r--gnl/gnlghostpad.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gnl/gnlghostpad.c b/gnl/gnlghostpad.c
index 8ccf24f..eeeb06f 100644
--- a/gnl/gnlghostpad.c
+++ b/gnl/gnlghostpad.c
@@ -673,7 +673,12 @@ gnl_object_ghost_pad_full (GnlObject * object, const gchar * name,
g_return_val_if_fail ((dir != GST_PAD_UNKNOWN), FALSE);
ghost = gnl_object_ghost_pad_no_target (object, name, dir);
- if (ghost && (!(gnl_object_ghost_pad_set_target (object, ghost, target)))) {
+ if (!ghost) {
+ GST_WARNING_OBJECT (object, "Couldn't create ghostpad");
+ return NULL;
+ }
+
+ if (!(gnl_object_ghost_pad_set_target (object, ghost, target))) {
GST_WARNING_OBJECT (object,
"Couldn't set the target pad... removing ghostpad");
gst_object_unref (ghost);