From 5fdff13205f87e4c863841cf67173ded8c880ea3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 1 Jun 2001 17:42:15 +0000 Subject: [PATCH] Print out a warning when the colorspace plugin is not found and try to do without it... Original commit message from CVS: Print out a warning when the colorspace plugin is not found and try to do without it... --- gstplay/gstplay.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gstplay/gstplay.c b/gstplay/gstplay.c index 6cb247765f..327129b61a 100644 --- a/gstplay/gstplay.c +++ b/gstplay/gstplay.c @@ -138,14 +138,22 @@ gst_play_init (GstPlay *play) gtk_signal_connect (GTK_OBJECT (priv->video_show), "have_size", GTK_SIGNAL_FUNC (gst_play_have_size), play); - colorspace = gst_elementfactory_make ("colorspace", "colorspace"); - gst_bin_add (GST_BIN (priv->video_element), colorspace); gst_bin_add (GST_BIN (priv->video_element), priv->video_show); - gst_element_connect (colorspace, "src", priv->video_show, "sink"); - gst_element_add_ghost_pad (priv->video_element, + colorspace = gst_elementfactory_make ("colorspace", "colorspace"); + if (colorspace == NULL) { + g_warning ("could not create a colorspace element, doing without"); + gst_element_add_ghost_pad (priv->video_element, + gst_element_get_pad (priv->video_show, "sink"), + "sink"); + } + else { + gst_bin_add (GST_BIN (priv->video_element), colorspace); + gst_element_connect (colorspace, "src", priv->video_show, "sink"); + gst_element_add_ghost_pad (priv->video_element, gst_element_get_pad (colorspace, "sink"), "sink"); + } play->state = GST_PLAY_STOPPED; play->flags = 0;