[farsight2/master] Check linking success as asap
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:26:50 PST 2008
---
transmitters/nice/fs-nice-transmitter.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/transmitters/nice/fs-nice-transmitter.c b/transmitters/nice/fs-nice-transmitter.c
index a6d508b..28e0f14 100644
--- a/transmitters/nice/fs-nice-transmitter.c
+++ b/transmitters/nice/fs-nice-transmitter.c
@@ -541,6 +541,14 @@ _create_sinksource (
else
ret = gst_pad_link (elempad, *requested_pad);
+
+ if (GST_PAD_LINK_FAILED(ret))
+ {
+ g_set_error (error, FS_ERROR, FS_ERROR_CONSTRUCTION,
+ "Could not link the new element %s (%d)", elementname, ret);
+ goto error;
+ }
+
if (have_buffer_callback && buffer_probe_id)
{
if (direction == GST_PAD_SINK)
@@ -568,13 +576,7 @@ _create_sinksource (
}
gst_object_unref (elempad);
-
- if (GST_PAD_LINK_FAILED(ret))
- {
- g_set_error (error, FS_ERROR, FS_ERROR_CONSTRUCTION,
- "Could not link the new element %s (%d)", elementname, ret);
- goto error;
- }
+ elempad = NULL;
if (!gst_element_sync_state_with_parent (elem))
{
--
1.5.6.5
More information about the farsight-commits
mailing list