mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-02-17 20:34:28 +01:00
audio: Patched to compile on C89 compilers.
This commit is contained in:
parent
244d2dbcd5
commit
b879595a2a
@ -1362,6 +1362,10 @@ open_audio_device(const char *devname, int iscapture,
|
|||||||
/* Start the audio thread if necessary */
|
/* Start the audio thread if necessary */
|
||||||
if (!current_audio.impl.ProvidesOwnCallbackThread) {
|
if (!current_audio.impl.ProvidesOwnCallbackThread) {
|
||||||
/* Start the audio thread */
|
/* Start the audio thread */
|
||||||
|
/* !!! FIXME: we don't force the audio thread stack size here if it calls into user code, but maybe we should? */
|
||||||
|
/* buffer queueing callback only needs a few bytes, so make the stack tiny. */
|
||||||
|
const size_t stacksize = is_internal_thread ? 64 * 1024 : 0;
|
||||||
|
char threadname[64];
|
||||||
|
|
||||||
/* Allocate a fake audio buffer; only used by our internal threads. */
|
/* Allocate a fake audio buffer; only used by our internal threads. */
|
||||||
Uint32 stream_len = (device->convert.needed) ? device->convert.len_cvt : 0;
|
Uint32 stream_len = (device->convert.needed) ? device->convert.len_cvt : 0;
|
||||||
@ -1377,12 +1381,8 @@ open_audio_device(const char *devname, int iscapture,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* !!! FIXME: we don't force the audio thread stack size here because it calls into user code, but maybe we should? */
|
SDL_snprintf(threadname, sizeof (threadname), "SDLAudioDev%d", (int) device->id);
|
||||||
/* buffer queueing callback only needs a few bytes, so make the stack tiny. */
|
device->thread = SDL_CreateThreadInternal(iscapture ? SDL_CaptureAudio : SDL_RunAudio, threadname, stacksize, device);
|
||||||
char name[64];
|
|
||||||
const size_t stacksize = is_internal_thread ? 64 * 1024 : 0;
|
|
||||||
SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) device->id);
|
|
||||||
device->thread = SDL_CreateThreadInternal(iscapture ? SDL_CaptureAudio : SDL_RunAudio, name, stacksize, device);
|
|
||||||
|
|
||||||
if (device->thread == NULL) {
|
if (device->thread == NULL) {
|
||||||
SDL_CloseAudioDevice(device->id);
|
SDL_CloseAudioDevice(device->id);
|
||||||
|
Loading…
Reference in New Issue
Block a user