From: Mark Nauwelaerts Date: Thu, 19 Jan 2012 15:32:37 +0000 (+0100) Subject: playsink: verify linking to overlay element X-Git-Tag: 1.19.3~511^2~6555^2~160 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be34d4c78ef9f31f5c7e3a58a546855e7e30dfae;p=platform%2Fupstream%2Fgstreamer.git playsink: verify linking to overlay element --- diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index a757b2d..d02ec60 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1603,10 +1603,18 @@ gen_text_chain (GstPlaySink * playsink) "max-size-bytes", 0, "max-size-time", (gint64) 0, "silent", TRUE, NULL); gst_bin_add (bin, element); - gst_element_link_pads_full (element, "src", chain->overlay, - "subtitle_sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS); - textsinkpad = gst_element_get_static_pad (element, "sink"); - srcpad = gst_element_get_static_pad (chain->overlay, "src"); + if (gst_element_link_pads_full (element, "src", chain->overlay, + "subtitle_sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) { + textsinkpad = gst_element_get_static_pad (element, "sink"); + srcpad = gst_element_get_static_pad (chain->overlay, "src"); + } else { + gst_bin_remove (bin, chain->sink); + gst_bin_remove (bin, chain->overlay); + chain->sink = NULL; + chain->overlay = NULL; + gst_object_unref (videosinkpad); + videosinkpad = NULL; + } } } }