Mercurial > sdl-ios-xcode
comparison src/audio/SDL_audio.c @ 4880:27c458e4ae31
Update VS2010 project to add new files; update new files so code builds on Win32/Win64
author | Andreas Schiffler <aschiffler@ferzkopp.net> |
---|---|
date | Mon, 23 Aug 2010 23:44:28 -0700 |
parents | 1f7ad083fd3c |
children |
comparison
equal
deleted
inserted
replaced
4864:ebcb4988b16f | 4880:27c458e4ae31 |
---|---|
27 #include "SDL_audio.h" | 27 #include "SDL_audio.h" |
28 #include "SDL_audio_c.h" | 28 #include "SDL_audio_c.h" |
29 #include "SDL_audiomem.h" | 29 #include "SDL_audiomem.h" |
30 #include "SDL_sysaudio.h" | 30 #include "SDL_sysaudio.h" |
31 | 31 |
32 #define _THIS SDL_AudioDevice *this | 32 #define _THIS SDL_AudioDevice *t |
33 | 33 |
34 static SDL_AudioDriver current_audio; | 34 static SDL_AudioDriver current_audio; |
35 static SDL_AudioDevice *open_devices[16]; | 35 static SDL_AudioDevice *open_devices[16]; |
36 | 36 |
37 /* !!! FIXME: These are wordy and unlocalized... */ | 37 /* !!! FIXME: These are wordy and unlocalized... */ |
319 if (stream->buffer != NULL) { | 319 if (stream->buffer != NULL) { |
320 SDL_free(stream->buffer); | 320 SDL_free(stream->buffer); |
321 } | 321 } |
322 } | 322 } |
323 | 323 |
324 | 324 #if defined(ANDROID) |
325 #include <android/log.h> | 325 #include <android/log.h> |
326 #endif | |
326 | 327 |
327 /* The general mixing thread function */ | 328 /* The general mixing thread function */ |
328 int SDLCALL | 329 int SDLCALL |
329 SDL_RunAudio(void *devicep) | 330 SDL_RunAudio(void *devicep) |
330 { | 331 { |
431 } | 432 } |
432 } | 433 } |
433 | 434 |
434 /* Read from the callback into the _input_ stream */ | 435 /* Read from the callback into the _input_ stream */ |
435 SDL_mutexP(device->mixer_lock); | 436 SDL_mutexP(device->mixer_lock); |
437 istream_len = 0; | |
436 (*fill) (udata, istream, istream_len); | 438 (*fill) (udata, istream, istream_len); |
437 SDL_mutexV(device->mixer_lock); | 439 SDL_mutexV(device->mixer_lock); |
438 | 440 |
439 /* Convert the audio if necessary and write to the streamer */ | 441 /* Convert the audio if necessary and write to the streamer */ |
440 if (device->convert.needed) { | 442 if (device->convert.needed) { |
889 return 0; | 891 return 0; |
890 } | 892 } |
891 device->opened = 1; | 893 device->opened = 1; |
892 | 894 |
893 /* Allocate a fake audio memory buffer */ | 895 /* Allocate a fake audio memory buffer */ |
894 device->fake_stream = SDL_AllocAudioMem(device->spec.size); | 896 device->fake_stream = (Uint8 *)SDL_AllocAudioMem(device->spec.size); |
895 if (device->fake_stream == NULL) { | 897 if (device->fake_stream == NULL) { |
896 close_audio_device(device); | 898 close_audio_device(device); |
897 SDL_OutOfMemory(); | 899 SDL_OutOfMemory(); |
898 return 0; | 900 return 0; |
899 } | 901 } |