coreaudio: Move some variable declarations to the top of the scope.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 02 Sep 2016 13:11:28 -0400
changeset 103063a17ad305b22
parent 10305 a289f7ea213b
child 10307 d8d0569ec151
coreaudio: Move some variable declarations to the top of the scope.
src/audio/coreaudio/SDL_coreaudio.c
     1.1 --- a/src/audio/coreaudio/SDL_coreaudio.c	Thu Sep 01 16:01:54 2016 -0300
     1.2 +++ b/src/audio/coreaudio/SDL_coreaudio.c	Fri Sep 02 13:11:28 2016 -0400
     1.3 @@ -437,17 +437,18 @@
     1.4  COREAUDIO_CloseDevice(_THIS)
     1.5  {
     1.6      const int iscapture = this->iscapture;
     1.7 +
     1.8      if (this->hidden->audioUnitOpened) {
     1.9 +        const AudioUnitElement output_bus = 0;
    1.10 +        const AudioUnitElement input_bus = 1;
    1.11 +        const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus);
    1.12 +        AURenderCallbackStruct callback;
    1.13 +
    1.14          #if MACOSX_COREAUDIO
    1.15          /* Unregister our disconnect callback. */
    1.16          AudioObjectRemovePropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this);
    1.17          #endif
    1.18  
    1.19 -        AURenderCallbackStruct callback;
    1.20 -        const AudioUnitElement output_bus = 0;
    1.21 -        const AudioUnitElement input_bus = 1;
    1.22 -        const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus);
    1.23 -
    1.24          /* stop processing the audio unit */
    1.25          AudioOutputUnitStop(this->hidden->audioUnit);
    1.26