[gcompris/gcomprixogoo] No more crashes if GCompris is started without music



commit 35fdf5279407c0992aca3eacf241ae1531ad798b
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Sun Dec 27 00:24:13 2009 +0100

    No more crashes if GCompris is started without music
    
    No more crashes if GCompris is started without music and
    that the user start the background music in the configuration
    dialog.

 src/gcompris/config.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/gcompris/config.c b/src/gcompris/config.c
index fcccf03..f3f5138 100644
--- a/src/gcompris/config.c
+++ b/src/gcompris/config.c
@@ -704,6 +704,8 @@ item_event_ok(GooCanvasItem *item,
   else if(!strcmp((char *)data, "music"))
     {
       properties->music = (properties->music ? 0 : 1);
+      if (properties->music)
+	gc_sound_init();
       g_object_set (item,
 		    "svg-id", (properties->music ? pixmap_checked : pixmap_unchecked),
 		    NULL);
@@ -720,6 +722,8 @@ item_event_ok(GooCanvasItem *item,
   else if(!strcmp((char *)data, "effect"))
     {
       properties->fx = (properties->fx ? 0 : 1);
+      if (properties->fx)
+	gc_sound_init();
       g_object_set (item,
 		    "svg-id", (properties->fx ? pixmap_checked : pixmap_unchecked),
 		    NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]