src/audio/macosx/SDL_coreaudio.c
changeset 2017 df06e6eb65c6
parent 2016 72fa74928062
child 2043 adf732f1f016
equal deleted inserted replaced
2016:72fa74928062 2017:df06e6eb65c6
   193     SDL_free(buffer);
   193     SDL_free(buffer);
   194 }
   194 }
   195 
   195 
   196 #define CHECK_RESULT(msg) \
   196 #define CHECK_RESULT(msg) \
   197     if (result != noErr) { \
   197     if (result != noErr) { \
   198         SDL_SetError("Failed to start CoreAudio: " msg); \
   198         SDL_SetError("CoreAudio error (%s): %d", msg, (int) result); \
   199         return -1; \
   199         return -1; \
   200     }
   200     }
   201 
   201 
   202 
   202 
   203 int
   203 int
   279         /* Set the input format of the audio unit. */
   279         /* Set the input format of the audio unit. */
   280         result = AudioUnitSetProperty(outputAudioUnit,
   280         result = AudioUnitSetProperty(outputAudioUnit,
   281                                       kAudioUnitProperty_StreamFormat,
   281                                       kAudioUnitProperty_StreamFormat,
   282                                       kAudioUnitScope_Input,
   282                                       kAudioUnitScope_Input,
   283                                       0,
   283                                       0,
   284                                       &desc, sizeof (desc));
   284                                       &strdesc, sizeof (strdesc));
   285     CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)")
   285     CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)")
   286         /* Set the audio callback */
   286         /* Set the audio callback */
   287         callback.inputProc = audioCallback;
   287         callback.inputProc = audioCallback;
   288     callback.inputProcRefCon = this;
   288     callback.inputProcRefCon = this;
   289     result = AudioUnitSetProperty(outputAudioUnit,
   289     result = AudioUnitSetProperty(outputAudioUnit,