#include "sl.h"
-slScheduler *slScheduler::current = NULL ;
char *__slPendingError = NULL ;
+slScheduler *slScheduler::current = NULL ;
+
void slScheduler::init ()
{
current = this ;
void slScheduler::initBuffers ()
{
- if ( not_working () ) return ;
+ if ( not_working () )
+ return ;
delete mixer_buffer ;
delete spare_buffer0 ;
void slScheduler::realUpdate ( int dump_first )
{
- int i ;
-
if ( not_working () )
return ;
if ( __slPendingError != NULL )
{
- fprintf ( stderr, __slPendingError ) ;
- exit ( 1 ) ;
+ fprintf ( stderr, "%s", __slPendingError ) ;
+ exit ( 1 ) ;
}
+ int i ;
+
while ( secondsUsed() <= safety_margin )
{
slSamplePlayer *psp [ 3 ] ;
void slScheduler::addCallBack ( slCallBack c, slSample *s, slEvent e, int m )
{
+ if ( not_working () )
+ return ;
+
if ( num_pending_callbacks >= SL_MAX_CALLBACKS )
{
fprintf ( stderr, "slScheduler: Too many pending callback events!\n" ) ;
void slScheduler::flushCallBacks ()
{
+ if ( not_working () )
+ return ;
+
/*
Execute all the callbacks that we accumulated
in this iteration.