mirror of
https://github.com/love2d/megasource.git
synced 2026-08-17 19:24:09 +02:00
Updated SDL to the latest hg revision.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -25,7 +25,7 @@ typedef struct
|
||||
{
|
||||
SDL_AudioDeviceID dev;
|
||||
int soundpos;
|
||||
volatile int done;
|
||||
SDL_atomic_t done;
|
||||
} callback_data;
|
||||
|
||||
callback_data cbd[64];
|
||||
@@ -46,14 +46,14 @@ play_through_once(void *arg, Uint8 * stream, int len)
|
||||
if (len > 0) {
|
||||
stream += cpy;
|
||||
SDL_memset(stream, spec.silence, len);
|
||||
cbd->done++;
|
||||
SDL_AtomicSet(&cbd->done, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
loop()
|
||||
{
|
||||
if(cbd[0].done) {
|
||||
if (SDL_AtomicGet(&cbd[0].done)) {
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_cancel_main_loop();
|
||||
#endif
|
||||
@@ -100,8 +100,7 @@ test_multi_audio(int devcount)
|
||||
#ifdef __EMSCRIPTEN__
|
||||
emscripten_set_main_loop(loop, 0, 1);
|
||||
#else
|
||||
while (!cbd[0].done)
|
||||
{
|
||||
while (!SDL_AtomicGet(&cbd[0].done)) {
|
||||
#ifdef __ANDROID__
|
||||
/* Empty queue, some application events would prevent pause. */
|
||||
while (SDL_PollEvent(&event)){}
|
||||
@@ -136,7 +135,7 @@ test_multi_audio(int devcount)
|
||||
while (keep_going) {
|
||||
keep_going = 0;
|
||||
for (i = 0; i < devcount; i++) {
|
||||
if ((cbd[i].dev) && (!cbd[i].done)) {
|
||||
if ((cbd[i].dev) && (!SDL_AtomicGet(&cbd[i].done))) {
|
||||
keep_going = 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user