cacasink: exit properly when invalid driver has been selected.
authorPriit Laes <plaes@plaes.org>
Mon, 19 Oct 2009 18:59:23 +0000 (21:59 +0300)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 22 Oct 2009 01:03:01 +0000 (02:03 +0100)
See #599018.

ext/libcaca/gstcacasink.c

index 07bd47e..8102fff 100644 (file)
@@ -350,7 +350,12 @@ static gboolean
 gst_cacasink_open (GstCACASink * cacasink)
 {
   cacasink->bitmap = NULL;
-  caca_init ();
+
+  if (caca_init () < 0) {
+    GST_ELEMENT_ERROR (cacasink, RESOURCE, OPEN_WRITE, (NULL),
+        ("caca_init() failed"));
+    return FALSE;
+  }
 
   cacasink->screen_width = caca_get_width ();
   cacasink->screen_height = caca_get_height ();