Mercurial > sdl-ios-xcode
comparison src/audio/SDL_audio.c @ 1901:f1828a500391
Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition.
Fixed performance problem with testsprite2 on the D3D driver.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 13 Jul 2006 08:13:02 +0000 |
parents | c121d94672cb |
children | f132024010be |
comparison
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; |