summaryrefslogtreecommitdiffstats
path: root/gst/liveadder
diff options
context:
space:
mode:
authorOlivier Crete <olivier.crete@collabora.co.uk>2008-04-03 02:03:18 +0000
committerEdward Hervey <bilboed@bilboed.com>2009-02-17 19:29:03 +0100
commit3a53d39191e8570a3a7444e491733a35c5b389a6 (patch)
tree8f5071e9e31f5f219ad19fd37afe646b4cd2a333 /gst/liveadder
parent5a48de94d77507db266e9e05242f93fe566f56a1 (diff)
downloadgst-plugins-bad-3a53d39191e8570a3a7444e491733a35c5b389a6.tar.gz
gst-plugins-bad-3a53d39191e8570a3a7444e491733a35c5b389a6.tar.bz2
gst-plugins-bad-3a53d39191e8570a3a7444e491733a35c5b389a6.zip
[MOVED FROM GST-P-FARSIGHT] Activate pads before adding them in case we're already playing
20080403020318-3e2dc-afd58f992c0b3057221b91034b2fcd91f296e52d.gz
Diffstat (limited to 'gst/liveadder')
-rw-r--r--gst/liveadder/liveadder.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gst/liveadder/liveadder.c b/gst/liveadder/liveadder.c
index ac349b95..a9eae5ea 100644
--- a/gst/liveadder/liveadder.c
+++ b/gst/liveadder/liveadder.c
@@ -1234,6 +1234,10 @@ gst_live_adder_request_new_pad (GstElement * element, GstPadTemplate * templ,
gst_pad_set_chain_function (newpad, gst_live_live_adder_chain);
+
+ if (!gst_pad_set_active (newpad, TRUE))
+ goto could_not_activate;
+
/* takes ownership of the pad */
if (!gst_element_add_pad (GST_ELEMENT (adder), newpad))
goto could_not_add;
@@ -1253,6 +1257,14 @@ not_sink:
could_not_add:
{
GST_DEBUG_OBJECT (adder, "could not add pad");
+ g_free (padprivate);
+ gst_object_unref (newpad);
+ return NULL;
+ }
+could_not_activate:
+ {
+ GST_DEBUG_OBJECT (adder, "could not activate new pad");
+ g_free (padprivate);
gst_object_unref (newpad);
return NULL;
}