changeset 23920:441492fb6b61

Fix up video preview error handling.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Wed, 27 Aug 2008 06:17:33 +0000
parents 4b8c64deac5e
children 16ce5da4d823
files pidgin/gtkprefs.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkprefs.c	Wed Aug 27 05:52:14 2008 +0000
+++ b/pidgin/gtkprefs.c	Wed Aug 27 06:17:33 2008 +0000
@@ -2069,7 +2069,7 @@
 
 	gst_element_set_state(pipeline, GST_STATE_NULL);
 	gst_object_unref(GST_PIPELINE(pipeline));
-	return TRUE;
+	return FALSE;
 }
 
 static void
@@ -2081,7 +2081,7 @@
 
 	/* create a preview window... */
 	GstElement *pipeline = NULL;
-	GError *p_err;
+	GError *p_err = NULL;
 
 	gchar *test_pipeline_str = NULL;
 
@@ -2098,6 +2098,13 @@
 
 	g_free(test_pipeline_str);
 
+	if (pipeline == NULL) {
+		purple_debug_error("gtkprefs",
+			"Error starting preview: %s\n", p_err->message);
+		g_error_free(p_err);
+		return;
+	}
+
 	bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
 	gst_bus_add_watch(bus, preview_video_bus_call, pipeline);
 	gst_object_unref(bus);