[Galago-commits] r3029 - in trunk/notification-daemon: . src/daemon
galago-commits at freedesktop.org
galago-commits at freedesktop.org
Tue Jan 13 22:49:03 PST 2009
Author: chipx86
Date: 2009-01-13 22:49:01 -0800 (Tue, 13 Jan 2009)
New Revision: 3029
Modified:
trunk/notification-daemon/ChangeLog
trunk/notification-daemon/src/daemon/sound.c
Log:
If we fail to initialize gstreamer correctly, just simply disable sound, instead of crashing.
Modified: trunk/notification-daemon/ChangeLog
===================================================================
--- trunk/notification-daemon/ChangeLog 2008-11-20 11:17:53 UTC (rev 3028)
+++ trunk/notification-daemon/ChangeLog 2009-01-14 06:49:01 UTC (rev 3029)
@@ -1,3 +1,9 @@
+Tue Jan 13 22:48:19 PST 2009 Christian Hammond <chipx86 at chipx86.com>
+
+ * src/daemon/sound.c:
+ - If we fail to initialize gstreamer correctly, just simply
+ disable sound, instead of crashing.
+
==================== 0.4.0 ====================
Thu Nov 20 02:54:36 PST 2008 Christian Hammond <chipx86 at chipx86.com>
Modified: trunk/notification-daemon/src/daemon/sound.c
===================================================================
--- trunk/notification-daemon/src/daemon/sound.c 2008-11-20 11:17:53 UTC (rev 3028)
+++ trunk/notification-daemon/src/daemon/sound.c 2009-01-14 06:49:01 UTC (rev 3029)
@@ -29,7 +29,10 @@
static void
sound_play_uri(const gchar* uri)
-{
+{
+ if (player == NULL)
+ return;
+
/*
* TODO: Fade out the current sound and then start the new sound?
* Right now we just cut off the existing sound, which is kind of
@@ -49,20 +52,22 @@
void
sound_init(void)
-{
+{
#ifdef HAVE_GSTREAMER
gst_init(NULL, NULL);
player = gst_element_factory_make("playbin", "Notification Player");
- /*
- * Instead of using the default audiosink, use the gconfaudiosink,
- * which will respect the defaults in gstreamer-properties
- */
- g_object_set(G_OBJECT(player), "audio-sink",
- gst_element_factory_make("gconfaudiosink", "GconfAudioSink"),
- NULL);
-
+ if (player != NULL)
+ {
+ /*
+ * Instead of using the default audiosink, use the gconfaudiosink,
+ * which will respect the defaults in gstreamer-properties
+ */
+ g_object_set(G_OBJECT(player), "audio-sink",
+ gst_element_factory_make("gconfaudiosink", "GconfAudioSink"),
+ NULL);
+ }
#endif /* HAVE_GSTREAMER */
}
More information about the galago-commits
mailing list