[gcompris] core, soundutil fixed a race condition



commit 4ce8375b84790130c13ddb44dd8ff529b460c51a
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Tue Oct 23 01:04:12 2012 +0200

    core, soundutil fixed a race condition
    
    It is best to clear our pending queue befor we cancel
    the sound in case the audio backend request another sound.

 src/gcompris/soundutil.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gcompris/soundutil.c b/src/gcompris/soundutil.c
index 2a71a2b..3c16a2e 100644
--- a/src/gcompris/soundutil.c
+++ b/src/gcompris/soundutil.c
@@ -228,7 +228,6 @@ gc_sound_play_ogg_list( GList* files )
     return;
 
   if (sound_policy == PLAY_AND_INTERRUPT ) {
-    gc_sound_fx_close();
     while ( g_list_length(pending_queue) > 0 )
     {
       tmpSound = g_list_nth_data( pending_queue, 0 );
@@ -236,6 +235,7 @@ gc_sound_play_ogg_list( GList* files )
       pending_queue = g_list_remove( pending_queue, tmpSound );
       gc_sound_callback(tmpSound);
     }
+    gc_sound_fx_close();
   }
 
   list = g_list_first( files );



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