]> Repos - portaudio/commitdiff
pa_mac_core.c: Removed some comments. Cleaned up logic.
authorPhil Burk <philburk@mobileer.com>
Tue, 17 May 2016 05:30:28 +0000 (22:30 -0700)
committerPhil Burk <philburk@mobileer.com>
Tue, 17 May 2016 05:30:28 +0000 (22:30 -0700)
src/hostapi/coreaudio/pa_mac_core.c
test/patest_unplug.c

index 87f483c69aa12c6c8873df7d56063d59c6c03534..0aede34c9f51c0f9ab377090fac3ec6be62d079a 100644 (file)
@@ -2279,7 +2279,6 @@ static OSStatus AudioIOProc( void *inRefCon,
                     &stream->inputAudioBufferList );
       if(err != noErr)
       {
-        /* We used to assert on error. Now we try to just stop the stream. */
         goto stop_stream;
       }
 
@@ -2361,7 +2360,7 @@ static OSStatus AudioIOProc( void *inRefCon,
                              &size,
                              (void *)&data );
                if( err == RING_BUFFER_EMPTY )
-               { /*the ring buffer callback underflowed */
+               { /* the ring buffer callback underflowed */
                   err = 0;
                   bzero( ((char *)data) + size, sizeof(data)-size );
                   /* The ring buffer can underflow normally when the stream is stopping.
@@ -2374,7 +2373,6 @@ static OSStatus AudioIOProc( void *inRefCon,
                ERR( err );
                if(err != noErr)
                {
-                 /* We used to assert on error. Now we try to just stop the stream. */
                  goto stop_stream;
                }
 
@@ -2486,7 +2484,6 @@ static OSStatus AudioIOProc( void *inRefCon,
       ERR( err );
       if(err != noErr)
       {
-          /* We used to assert on error. Now we try to just stop the stream. */
           goto stop_stream;
       }
 
@@ -2551,8 +2548,7 @@ static OSStatus AudioIOProc( void *inRefCon,
                ERR( err );
             if( err != noErr && err != RING_BUFFER_EMPTY )
             {
-              /* We used to assert on error. Now we try to just stop the stream. */
-              goto stop_stream;
+                goto stop_stream;
             }
 
 
@@ -2577,18 +2573,12 @@ static OSStatus AudioIOProc( void *inRefCon,
       }
    }
 
-   switch( callbackResult )
-   {
-   case paContinue:
-           break;
-   case paComplete:
-   case paAbort:
-           goto stop_stream;
-      break;
-   }
-
-   PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed );
-   return noErr;
+    // Should we return successfully or fall through to stopping the stream?
+    if( callbackResult == paContinue )
+    {
+        PaUtil_EndCpuLoadMeasurement( &stream->cpuLoadMeasurer, framesProcessed );
+        return noErr;
+    }
 
 stop_stream:
     stream->state = CALLBACK_STOPPED ;
@@ -2601,7 +2591,6 @@ stop_stream:
     return noErr;
 }
 
-
 /*
     When CloseStream() is called, the multi-api layer ensures that
     the stream has already been stopped or aborted.
index b48f7ff35b49220b4c7e179f4ccfc29c807301dc..ba55b7dee1530314c4c68c3540c9df70866cd361 100644 (file)
  */
 
 /*
- * The text above constitutes the entire PortAudio license; however, 
+ * The text above constitutes the entire PortAudio license; however,
  * the PortAudio community also makes the following non-binding requests:
  *
  * Any person wishing to distribute modifications to the Software is
  * requested to send the modifications to the original developer so that
- * they can be incorporated into the canonical version. It is also 
- * requested that these non-binding requests be included along with the 
+ * they can be incorporated into the canonical version. It is also
+ * requested that these non-binding requests be included along with the
  * license above.
  */