Removed unneeded audio buffer memset() for consistent behavior on all platforms.
authorSam Lantinga
Thu, 05 Jul 2012 12:16:44 -0400
changeset 6352a9bcd26e7105
parent 6351 8f5535d05e34
child 6354 17840f487124
Removed unneeded audio buffer memset() for consistent behavior on all platforms.
src/audio/baudio/SDL_beaudio.cc
src/audio/coreaudio/SDL_coreaudio.c
src/audio/qsa/SDL_qsa_audio.c
src/audio/winmm/SDL_winmm.c
src/audio/xaudio2/SDL_xaudio2.c
     1.1 --- a/src/audio/baudio/SDL_beaudio.cc	Thu Jul 05 07:26:18 2012 -0400
     1.2 +++ b/src/audio/baudio/SDL_beaudio.cc	Thu Jul 05 12:16:44 2012 -0400
     1.3 @@ -48,9 +48,6 @@
     1.4  {
     1.5      SDL_AudioDevice *audio = (SDL_AudioDevice *) device;
     1.6  
     1.7 -    /* Silence the buffer, since it's ours */
     1.8 -    SDL_memset(stream, audio->spec.silence, len);
     1.9 -
    1.10      /* Only do soemthing if audio is enabled */
    1.11      if (!audio->enabled)
    1.12          return;
     2.1 --- a/src/audio/coreaudio/SDL_coreaudio.c	Thu Jul 05 07:26:18 2012 -0400
     2.2 +++ b/src/audio/coreaudio/SDL_coreaudio.c	Thu Jul 05 12:16:44 2012 -0400
     2.3 @@ -280,8 +280,6 @@
     2.4          while (remaining > 0) {
     2.5              if (this->hidden->bufferOffset >= this->hidden->bufferSize) {
     2.6                  /* Generate the data */
     2.7 -                SDL_memset(this->hidden->buffer, this->spec.silence,
     2.8 -                           this->hidden->bufferSize);
     2.9                  SDL_mutexP(this->mixer_lock);
    2.10                  (*this->spec.callback)(this->spec.userdata,
    2.11                              this->hidden->buffer, this->hidden->bufferSize);
    2.12 @@ -336,7 +334,7 @@
    2.13              result = AudioOutputUnitStop(this->hidden->audioUnit);
    2.14  
    2.15              /* Remove the input callback */
    2.16 -            SDL_memset(&callback, '\0', sizeof(AURenderCallbackStruct));
    2.17 +            SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct));
    2.18              result = AudioUnitSetProperty(this->hidden->audioUnit,
    2.19                                            kAudioUnitProperty_SetRenderCallback,
    2.20                                            scope, bus, &callback,
    2.21 @@ -431,7 +429,7 @@
    2.22      CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)");
    2.23  
    2.24      /* Set the audio callback */
    2.25 -    SDL_memset(&callback, '\0', sizeof(AURenderCallbackStruct));
    2.26 +    SDL_memset(&callback, 0, sizeof(AURenderCallbackStruct));
    2.27      callback.inputProc = ((iscapture) ? inputCallback : outputCallback);
    2.28      callback.inputProcRefCon = this;
    2.29      result = AudioUnitSetProperty(this->hidden->audioUnit,
     3.1 --- a/src/audio/qsa/SDL_qsa_audio.c	Thu Jul 05 07:26:18 2012 -0400
     3.2 +++ b/src/audio/qsa/SDL_qsa_audio.c	Thu Jul 05 12:16:44 2012 -0400
     3.3 @@ -570,7 +570,7 @@
     3.4      }
     3.5  
     3.6      /* Make sure channel is setup right one last time */
     3.7 -    SDL_memset(&csetup, '\0', sizeof(csetup));
     3.8 +    SDL_memset(&csetup, 0, sizeof(csetup));
     3.9      if (!this->hidden->iscapture) {
    3.10          csetup.channel = SND_PCM_CHANNEL_PLAYBACK;
    3.11      } else {
     4.1 --- a/src/audio/winmm/SDL_winmm.c	Thu Jul 05 07:26:18 2012 -0400
     4.2 +++ b/src/audio/winmm/SDL_winmm.c	Thu Jul 05 12:16:44 2012 -0400
     4.3 @@ -369,7 +369,7 @@
     4.4          return 0;
     4.5      }
     4.6      for (i = 0; i < NUM_BUFFERS; ++i) {
     4.7 -        SDL_memset(&this->hidden->wavebuf[i], '\0',
     4.8 +        SDL_memset(&this->hidden->wavebuf[i], 0,
     4.9                     sizeof(this->hidden->wavebuf[i]));
    4.10          this->hidden->wavebuf[i].dwBufferLength = this->spec.size;
    4.11          this->hidden->wavebuf[i].dwFlags = WHDR_DONE;
     5.1 --- a/src/audio/xaudio2/SDL_xaudio2.c	Thu Jul 05 07:26:18 2012 -0400
     5.2 +++ b/src/audio/xaudio2/SDL_xaudio2.c	Thu Jul 05 12:16:44 2012 -0400
     5.3 @@ -332,7 +332,7 @@
     5.4          return 0;
     5.5      }
     5.6      this->hidden->nextbuf = this->hidden->mixbuf;
     5.7 -    SDL_memset(this->hidden->mixbuf, '\0', 2 * this->hidden->mixlen);
     5.8 +    SDL_memset(this->hidden->mixbuf, 0, 2 * this->hidden->mixlen);
     5.9  
    5.10      /* We use XAUDIO2_DEFAULT_CHANNELS instead of this->spec.channels. On
    5.11         Xbox360, this means 5.1 output, but on Windows, it means "figure out