Fixed RtError::WARNING mistake in RtAudio.
authorGary Scavone <gary@music.mcgill.ca>
Mon, 13 Aug 2007 19:10:10 +0000 (19:10 +0000)
committerStephen Sinclair <sinclair@music.mcgill.ca>
Thu, 10 Oct 2013 23:22:16 +0000 (01:22 +0200)
Also, changed pthread setsched priority code a bit for ALSA ... not fully tested.

RtAudio.cpp

index bc3a42bf5e3f2bd54eb7b4bf45422bf2289b71b7..376319c751210e71cfd1e02c7288d68332cae84f 100644 (file)
@@ -5906,7 +5906,9 @@ extern "C" void *alsaCallbackHandler( void *ptr )
 #ifdef SCHED_RR
   // Set a higher scheduler priority (P.J. Leonard)
   struct sched_param param;
-  param.sched_priority = 39;   // Is this the best number?
+  int min = sched_get_priority_min( SCHED_RR );
+  int max = sched_get_priority_max( SCHED_RR );
+  param.sched_priority = min + ( max - min ) / 2;   // Is this the best number?
   sched_setscheduler( 0, SCHED_RR, &param );
 #endif
 
@@ -6832,7 +6834,7 @@ extern "C" void *ossCallbackHandler( void *ptr )
 // message printing.
 void RtApi :: error( RtError::Type type )
 {
-  if ( type == RtError::RtError::WARNING && showWarnings_ == true )
+  if ( type == RtError::WARNING && showWarnings_ == true )
     std::cerr << '\n' << errorText_ << "\n\n";
   else
     throw( RtError( errorText_, type ) );