playsink: verify linking to overlay element

This commit is contained in:
Mark Nauwelaerts 2012-01-19 16:32:37 +01:00
parent e5f6675ea3
commit be34d4c78e

View file

@ -1603,10 +1603,18 @@ gen_text_chain (GstPlaySink * playsink)
"max-size-bytes", 0, "max-size-time", (gint64) 0, "max-size-bytes", 0, "max-size-time", (gint64) 0,
"silent", TRUE, NULL); "silent", TRUE, NULL);
gst_bin_add (bin, element); gst_bin_add (bin, element);
gst_element_link_pads_full (element, "src", chain->overlay, if (gst_element_link_pads_full (element, "src", chain->overlay,
"subtitle_sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS); "subtitle_sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) {
textsinkpad = gst_element_get_static_pad (element, "sink"); textsinkpad = gst_element_get_static_pad (element, "sink");
srcpad = gst_element_get_static_pad (chain->overlay, "src"); 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;
}
} }
} }
} }