[xiph-commits] r17690 - trunk/squishyball

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon Nov 29 20:59:33 PST 2010


Author: xiphmont
Date: 2010-11-29 20:59:33 -0800 (Mon, 29 Nov 2010)
New Revision: 17690

Modified:
   trunk/squishyball/main.c
Log:
Don't sleep on main loop cond var before checking exit state.



Modified: trunk/squishyball/main.c
===================================================================
--- trunk/squishyball/main.c	2010-11-30 03:44:05 UTC (rev 17689)
+++ trunk/squishyball/main.c	2010-11-30 04:59:33 UTC (rev 17690)
@@ -649,6 +649,9 @@
       int c;
       if(state.exiting) break;
 
+      if((!state.key_waiting || do_flip || do_pause || do_select) && state.fragment_size>0)
+        pthread_cond_wait(&state.main_cond,&state.mutex);
+
       /* seeks and some other ops are batched */
       if(state.key_waiting && !do_flip && !do_pause && !do_select){
         /* service keyboard */
@@ -970,10 +973,6 @@
         state.fragment_size=fragsize;
         pthread_cond_signal(&state.play_cond);
       }
-
-      /* wait */
-      if((!state.key_waiting || do_flip || do_pause || do_select) && state.fragment_size>0)
-        pthread_cond_wait(&state.main_cond,&state.mutex);
     }
   }
 



More information about the commits mailing list