src/audio/emscripten/SDL_emscriptenaudio.c
changeset 10997 b6315b6bc32f
parent 10765 61312c8c59fe
child 11034 fcb1f3161d2e
     1.1 --- a/src/audio/emscripten/SDL_emscriptenaudio.c	Tue May 09 03:19:58 2017 -0700
     1.2 +++ b/src/audio/emscripten/SDL_emscriptenaudio.c	Wed May 10 16:18:43 2017 -0400
     1.3 @@ -52,7 +52,7 @@
     1.4  static void
     1.5  HandleAudioProcess(_THIS)
     1.6  {
     1.7 -    SDL_AudioCallback callback = this->spec.callback;
     1.8 +    SDL_AudioCallback callback = this->callbackspec.callback;
     1.9      const int stream_len = this->callbackspec.size;
    1.10  
    1.11      /* Only do something if audio is enabled */
    1.12 @@ -65,11 +65,11 @@
    1.13  
    1.14      if (this->stream == NULL) {  /* no conversion necessary. */
    1.15          SDL_assert(this->spec.size == stream_len);
    1.16 -        callback(this->spec.userdata, this->work_buffer, stream_len);
    1.17 +        callback(this->callbackspec.userdata, this->work_buffer, stream_len);
    1.18      } else {  /* streaming/converting */
    1.19          int got;
    1.20          while (SDL_AudioStreamAvailable(this->stream) < ((int) this->spec.size)) {
    1.21 -            callback(this->spec.userdata, this->work_buffer, stream_len);
    1.22 +            callback(this->callbackspec.userdata, this->work_buffer, stream_len);
    1.23              if (SDL_AudioStreamPut(this->stream, this->work_buffer, stream_len) == -1) {
    1.24                  SDL_AudioStreamClear(this->stream);
    1.25                  SDL_AtomicSet(&this->enabled, 0);
    1.26 @@ -90,7 +90,7 @@
    1.27  static void
    1.28  HandleCaptureProcess(_THIS)
    1.29  {
    1.30 -    SDL_AudioCallback callback = this->spec.callback;
    1.31 +    SDL_AudioCallback callback = this->callbackspec.callback;
    1.32      const int stream_len = this->callbackspec.size;
    1.33  
    1.34      /* Only do something if audio is enabled */
    1.35 @@ -123,7 +123,7 @@
    1.36  
    1.37      if (this->stream == NULL) {  /* no conversion necessary. */
    1.38          SDL_assert(this->spec.size == stream_len);
    1.39 -        callback(this->spec.userdata, this->work_buffer, stream_len);
    1.40 +        callback(this->callbackspec.userdata, this->work_buffer, stream_len);
    1.41      } else {  /* streaming/converting */
    1.42          if (SDL_AudioStreamPut(this->stream, this->work_buffer, this->spec.size) == -1) {
    1.43              SDL_AtomicSet(&this->enabled, 0);
    1.44 @@ -135,7 +135,7 @@
    1.45              if (got != stream_len) {
    1.46                  SDL_memset(this->work_buffer, this->callbackspec.silence, stream_len);
    1.47              }
    1.48 -            callback(this->spec.userdata, this->work_buffer, stream_len);  /* Send it to the app. */
    1.49 +            callback(this->callbackspec.userdata, this->work_buffer, stream_len);  /* Send it to the app. */
    1.50          }
    1.51      }
    1.52  }