mixer.c
changeset 727 119df1a05eb7
parent 725 bdf7b8d20566
child 738 e6fa426a79dd
     1.1 --- a/mixer.c	Fri Jan 20 02:23:51 2017 -0500
     1.2 +++ b/mixer.c	Wed May 24 16:41:47 2017 -0400
     1.3 @@ -25,9 +25,7 @@
     1.4  #include <stdlib.h>
     1.5  #include <string.h>
     1.6  
     1.7 -#include "SDL_mutex.h"
     1.8 -#include "SDL_endian.h"
     1.9 -#include "SDL_timer.h"
    1.10 +#include "SDL.h"
    1.11  
    1.12  #include "SDL_mixer.h"
    1.13  #include "mixer.h"
    1.14 @@ -435,6 +433,15 @@
    1.15      int i;
    1.16      SDL_AudioSpec desired;
    1.17  
    1.18 +    /* This used to call SDL_OpenAudio(), which initializes the audio
    1.19 +       subsystem if necessary. Since SDL_OpenAudioDevice() doesn't,
    1.20 +       we have to handle this case here. */
    1.21 +    if (!SDL_WasInit(SDL_INIT_AUDIO)) {
    1.22 +        if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) {
    1.23 +            return -1;
    1.24 +        }
    1.25 +    }
    1.26 +
    1.27      /* If the mixer is already opened, increment open count */
    1.28      if ( audio_opened ) {
    1.29          if ( format == mixer.format && nchannels == mixer.channels ) {