src/audio/SDL_audio.c
changeset 1901 f1828a500391
parent 1895 c121d94672cb
child 1903 f132024010be
equal deleted inserted replaced
1900:5c6bdbf3aadf 1901:f1828a500391
   495         desired->format = AUDIO_S16;
   495         desired->format = AUDIO_S16;
   496     }
   496     }
   497     if (desired->channels == 0) {
   497     if (desired->channels == 0) {
   498         env = SDL_getenv("SDL_AUDIO_CHANNELS");
   498         env = SDL_getenv("SDL_AUDIO_CHANNELS");
   499         if (env) {
   499         if (env) {
   500             desired->channels = SDL_atoi(env);
   500             desired->channels = (Uint8)SDL_atoi(env);
   501         }
   501         }
   502     }
   502     }
   503     if (desired->channels == 0) {
   503     if (desired->channels == 0) {
   504         /* Pick a default number of channels */
   504         /* Pick a default number of channels */
   505         desired->channels = 2;
   505         desired->channels = 2;
   515         return (-1);
   515         return (-1);
   516     }
   516     }
   517     if (desired->samples == 0) {
   517     if (desired->samples == 0) {
   518         env = SDL_getenv("SDL_AUDIO_SAMPLES");
   518         env = SDL_getenv("SDL_AUDIO_SAMPLES");
   519         if (env) {
   519         if (env) {
   520             desired->samples = SDL_atoi(env);
   520             desired->samples = (Uint16)SDL_atoi(env);
   521         }
   521         }
   522     }
   522     }
   523     if (desired->samples == 0) {
   523     if (desired->samples == 0) {
   524         /* Pick a default of ~46 ms at desired frequency */
   524         /* Pick a default of ~46 ms at desired frequency */
   525         int samples = (desired->freq / 1000) * 46;
   525         int samples = (desired->freq / 1000) * 46;