Explorar o código

coreaudio: Move some variable declarations to the top of the scope.

Ryan C. Gordon %!s(int64=9) %!d(string=hai) anos
pai
achega
f9d9708f6b
Modificáronse 1 ficheiros con 6 adicións e 5 borrados
  1. 6 5
      src/audio/coreaudio/SDL_coreaudio.c

+ 6 - 5
src/audio/coreaudio/SDL_coreaudio.c

@@ -437,17 +437,18 @@ static void
 COREAUDIO_CloseDevice(_THIS)
 {
     const int iscapture = this->iscapture;
+
     if (this->hidden->audioUnitOpened) {
+        const AudioUnitElement output_bus = 0;
+        const AudioUnitElement input_bus = 1;
+        const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus);
+        AURenderCallbackStruct callback;
+
         #if MACOSX_COREAUDIO
         /* Unregister our disconnect callback. */
         AudioObjectRemovePropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this);
         #endif
 
-        AURenderCallbackStruct callback;
-        const AudioUnitElement output_bus = 0;
-        const AudioUnitElement input_bus = 1;
-        const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus);
-
         /* stop processing the audio unit */
         AudioOutputUnitStop(this->hidden->audioUnit);