<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/f762596eae19016b52e348a78120f37ab69b693e">https://github.com/macports/macports-ports/commit/f762596eae19016b52e348a78120f37ab69b693e</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new f762596 libsdl2: update to 2.0.10
</span>f762596 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit f762596eae19016b52e348a78120f37ab69b693e
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Mon Jul 29 09:41:49 2019 +1000
<span style='display:block; white-space:pre;color:#404040;'> libsdl2: update to 2.0.10
</span>---
devel/libsdl2/Portfile | 16 +-
devel/libsdl2/files/5a95fbfd3617.patch | 23 --
devel/libsdl2/files/d274fa9731b1.patch | 26 ---
devel/libsdl2/files/dcb6c57df2fc.patch | 374 ---------------------------------
4 files changed, 3 insertions(+), 436 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/libsdl2/Portfile b/devel/libsdl2/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 5c51583..e217e92 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/libsdl2/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/libsdl2/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -6,8 +6,7 @@ PortGroup xcodeversion 1.0
</span>
name libsdl2
set my_name SDL2
<span style='display:block; white-space:pre;background:#ffe0e0;'>-version 2.0.9
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 2.0.10
</span> categories devel multimedia
platforms macosx freebsd
license zlib
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -23,17 +22,8 @@ homepage http://www.libsdl.org/
</span> master_sites ${homepage}release/
distname ${my_name}-${version}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums rmd160 db2efabf55af41cddf015db0b5213b11ef22b9d0 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 255186dc676ecd0c1dbf10ec8a2cc5d6869b5079d8a38194c2aecdff54b324b1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Fix build on 10.7: https://trac.macports.org/ticket/57540
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles 5a95fbfd3617.patch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Fix library compatibility version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles-append d274fa9731b1.patch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Fix dropping audio buffers, https://trac.macports.org/ticket/58551
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles-append dcb6c57df2fc.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums rmd160 b35818cbf8eaf0c9c4d3b6d7a293c05a368366b2 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 b4656c13a1f0d0023ae2f4a9cf08ec92fffb464e0f24238337784159b8b91d57
</span>
configure.args --without-x
build.args V=1
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/libsdl2/files/5a95fbfd3617.patch b/devel/libsdl2/files/5a95fbfd3617.patch
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 2909e8c..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/libsdl2/files/5a95fbfd3617.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,23 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# HG changeset patch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# User Alex Szpakowski <slime73@gmail.com>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Date 1541897783 14400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Node ID 5a95fbfd3617b3a309cd3f3a37143bde98872e28
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Parent eb60e952b13fcd5fd00bafdaf1f209a5d3fb9d73
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-cocoa: fix building with the macOS 10.7 SDK (thanks Riccardo!)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Fixes bug #4368
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -r eb60e952b13f -r 5a95fbfd3617 src/video/cocoa/SDL_cocoawindow.m
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/video/cocoa/SDL_cocoawindow.m Sat Nov 10 16:15:48 2018 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/video/cocoa/SDL_cocoawindow.m Sat Nov 10 20:56:23 2018 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1185,7 +1185,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Force the graphics context to clear to black so we don't get a flash of
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- white until the app is ready to draw. In practice on modern macOS, this
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- only gets called for window creation and other extraordinary events. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- self.layer.backgroundColor = NSColor.blackColor.CGColor;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ self.layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ScheduleContextUpdates((SDL_WindowData *) _sdlWindow->driverdata);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SDL_SendWindowEvent(_sdlWindow, SDL_WINDOWEVENT_EXPOSED, 0, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/libsdl2/files/d274fa9731b1.patch b/devel/libsdl2/files/d274fa9731b1.patch
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 1aa3ee3..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/libsdl2/files/d274fa9731b1.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,26 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# HG changeset patch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# User Sam Lantinga <slouken@libsdl.org>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Date 1542069298 28800
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Node ID d274fa9731b17af90b3b95a211d327c307d90360
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Parent 5a95fbfd3617b3a309cd3f3a37143bde98872e28
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Fixed bug 4367 - compatibility version decreased between 2.0.8 and 2.0.9
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -r 5a95fbfd3617 -r d274fa9731b1 build-scripts/ltmain.sh
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- build-scripts/ltmain.sh Sat Nov 10 20:56:23 2018 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ build-scripts/ltmain.sh Mon Nov 12 16:34:58 2018 -0800
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -7404,11 +7404,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # Darwin ld doesn't like 0 for these options...
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- func_arith $current + 1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- minor_current=$func_arith_result
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- #xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- #verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- # make the compatibility version match the Xcode project files, i.e. 1.0
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- xlcverstring="${wl}-compatibility_version 1.0 ${wl}-current_version ${wl}$minor_current.$revision"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- verstring="-compatibility_version 1.0 -current_version $minor_current.$revision"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ;;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- freebsd-aout)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/libsdl2/files/dcb6c57df2fc.patch b/devel/libsdl2/files/dcb6c57df2fc.patch
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 27079af..0000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/libsdl2/files/dcb6c57df2fc.patch
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,374 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# HG changeset patch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# User Ryan C. Gordon <icculus@icculus.org>
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Date 1553531078 14400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Node ID dcb6c57df2fc8fbf5b82d04782322f64658a5e0b
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Parent 36ee991073903add82a71be51943e3b650558c5a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Backed out changeset ffd52bb02bcc
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-This was meant to migrate CoreAudio onto the same SDL_RunAudio() path that
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-most other audio drivers are on, but it introduced a bug because it doesn't
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-deal with dropped audio buffers...and fixing that properly just introduces
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-latency.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-I might revisit this later, perhaps by reworking SDL_RunAudio to allow for
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-this sort of API better, or redesigning the whole subsystem or something, I
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-don't know. I'm not super-thrilled that this has to exist outside of the usual
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-codepaths, though.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-Fixes Bugzilla #4481.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -r 36ee99107390 -r dcb6c57df2fc src/audio/SDL_audio.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/audio/SDL_audio.c Thu Mar 21 10:39:49 2019 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/audio/SDL_audio.c Mon Mar 25 12:24:38 2019 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -896,8 +896,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- current_audio.impl.PrepareToClose(device);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- current_audio.impl.FlushCapture(device);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- current_audio.impl.ThreadDeinit(device);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -r 36ee99107390 -r dcb6c57df2fc src/audio/coreaudio/SDL_coreaudio.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/audio/coreaudio/SDL_coreaudio.h Thu Mar 21 10:39:49 2019 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/audio/coreaudio/SDL_coreaudio.h Mon Mar 25 12:24:38 2019 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -45,14 +45,16 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- struct SDL_PrivateAudioData
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_Thread *thread;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AudioQueueRef audioQueue;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- int numAudioBuffers;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AudioQueueBufferRef *audioBuffer;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- void *buffer;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ UInt32 bufferOffset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- UInt32 bufferSize;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AudioStreamBasicDescription strdesc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_bool refill;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_AudioStream *capturestream;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_sem *ready_semaphore;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ char *thread_error;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_atomic_t shutdown;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if MACOSX_COREAUDIO
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AudioDeviceID deviceID;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #else
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff -r 36ee99107390 -r dcb6c57df2fc src/audio/coreaudio/SDL_coreaudio.m
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/audio/coreaudio/SDL_coreaudio.m Thu Mar 21 10:39:49 2019 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/audio/coreaudio/SDL_coreaudio.m Mon Mar 25 12:24:38 2019 -0400
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -26,7 +26,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "SDL_audio.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "SDL_hints.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--#include "SDL_timer.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "../SDL_audio_c.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "../SDL_sysaudio.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #include "SDL_coreaudio.h"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -410,27 +409,43 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- outputCallback(void *inUserData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SDL_AudioDevice *this = (SDL_AudioDevice *) inUserData;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_assert(inBuffer->mAudioDataBytesCapacity == this->hidden->bufferSize);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_memcpy(inBuffer->mAudioData, this->hidden->buffer, this->hidden->bufferSize);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_memset(this->hidden->buffer, '\0', this->hidden->bufferSize); /* zero out in case we have to fill again without new data. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- inBuffer->mAudioDataByteSize = this->hidden->bufferSize;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (SDL_AtomicGet(&this->hidden->shutdown)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return; /* don't do anything. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!SDL_AtomicGet(&this->enabled) || SDL_AtomicGet(&this->paused)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Supply silence if audio is not enabled or paused */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_memset(inBuffer->mAudioData, this->spec.silence, inBuffer->mAudioDataBytesCapacity);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ UInt32 remaining = inBuffer->mAudioDataBytesCapacity;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ Uint8 *ptr = (Uint8 *) inBuffer->mAudioData;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (remaining > 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ UInt32 len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (this->hidden->bufferOffset >= this->hidden->bufferSize) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Generate the data */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_LockMutex(this->mixer_lock);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (*this->callbackspec.callback)(this->callbackspec.userdata,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->buffer, this->hidden->bufferSize);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_UnlockMutex(this->mixer_lock);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->bufferOffset = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ len = this->hidden->bufferSize - this->hidden->bufferOffset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (len > remaining) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ len = remaining;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_memcpy(ptr, (char *)this->hidden->buffer +
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->bufferOffset, len);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ptr = ptr + len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ remaining -= len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->bufferOffset += len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AudioQueueEnqueueBuffer(this->hidden->audioQueue, inBuffer, 0, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->refill = SDL_TRUE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static Uint8 *
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--COREAUDIO_GetDeviceBuf(_THIS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return this->hidden->buffer;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static void
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--COREAUDIO_WaitDevice(_THIS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- while (SDL_AtomicGet(&this->enabled) && !this->hidden->refill) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.10, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->refill = SDL_FALSE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ inBuffer->mAudioDataByteSize = inBuffer->mAudioDataBytesCapacity;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static void
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -439,46 +454,36 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const AudioStreamPacketDescription *inPacketDescs )
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SDL_AudioDevice *this = (SDL_AudioDevice *) inUserData;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (SDL_AtomicGet(&this->enabled)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_AudioStream *stream = this->hidden->capturestream;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (SDL_AudioStreamPut(stream, inBuffer->mAudioData, inBuffer->mAudioDataByteSize) == -1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- /* yikes, out of memory or something. I guess drop the buffer. Our WASAPI target kills the device in this case, though */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- AudioQueueEnqueueBuffer(this->hidden->audioQueue, inBuffer, 0, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->refill = SDL_TRUE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--COREAUDIO_CaptureFromDevice(_THIS, void *buffer, int buflen)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_AudioStream *stream = this->hidden->capturestream;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- while (SDL_AtomicGet(&this->enabled)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- const int avail = SDL_AudioStreamAvailable(stream);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (avail > 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- const int cpy = SDL_min(buflen, avail);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_AudioStreamGet(stream, buffer, cpy);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return cpy;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- /* wait for more data, try again. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- while (SDL_AtomicGet(&this->enabled) && !this->hidden->refill) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.10, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->refill = SDL_FALSE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (SDL_AtomicGet(&this->shutdown)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return; /* don't do anything. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return 0; /* not enabled, giving up. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* ignore unless we're active. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!SDL_AtomicGet(&this->paused) && SDL_AtomicGet(&this->enabled) && !SDL_AtomicGet(&this->paused)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const Uint8 *ptr = (const Uint8 *) inBuffer->mAudioData;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ UInt32 remaining = inBuffer->mAudioDataByteSize;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (remaining > 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ UInt32 len = this->hidden->bufferSize - this->hidden->bufferOffset;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (len > remaining) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ len = remaining;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static void
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--COREAUDIO_FlushCapture(_THIS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, 1) == kCFRunLoopRunHandledSource) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- /* spin. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_memcpy((char *)this->hidden->buffer + this->hidden->bufferOffset, ptr, len);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ ptr += len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ remaining -= len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->bufferOffset += len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (this->hidden->bufferOffset >= this->hidden->bufferSize) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_LockMutex(this->mixer_lock);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ (*this->callbackspec.callback)(this->callbackspec.userdata, this->hidden->buffer, this->hidden->bufferSize);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_UnlockMutex(this->mixer_lock);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->bufferOffset = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->refill = SDL_FALSE;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_AudioStreamClear(this->hidden->capturestream);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ AudioQueueEnqueueBuffer(this->hidden->audioQueue, inBuffer, 0, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -536,16 +541,25 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- update_audio_session(this, SDL_FALSE);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* if callback fires again, feed silence; don't call into the app. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_AtomicSet(&this->paused, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (this->hidden->audioQueue) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AudioQueueDispose(this->hidden->audioQueue, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (this->hidden->capturestream) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_FreeAudioStream(this->hidden->capturestream);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (this->hidden->thread) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_AtomicSet(&this->hidden->shutdown, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_WaitThread(this->hidden->thread, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (this->hidden->ready_semaphore) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_DestroySemaphore(this->hidden->ready_semaphore);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* AudioQueueDispose() frees the actual buffer objects. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SDL_free(this->hidden->audioBuffer);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_free(this->hidden->thread_error);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SDL_free(this->hidden->buffer);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SDL_free(this->hidden);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -611,8 +625,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--/* this all happens in the audio thread, since it needs a separate runloop. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- prepare_audioqueue(_THIS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -652,6 +664,19 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Calculate the final parameters for this audio specification */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_CalculateAudioSpec(&this->spec);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* Allocate a sample buffer */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->bufferSize = this->spec.size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->bufferOffset = iscapture ? 0 : this->hidden->bufferSize;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->buffer = SDL_malloc(this->hidden->bufferSize);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (this->hidden->buffer == NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_OutOfMemory();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Make sure we can feed the device a minimum amount of time */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- double MINIMUM_AUDIO_BUFFER_TIME_MS = 15.0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if defined(__IPHONEOS__)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -666,7 +691,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- numAudioBuffers = ((int)SDL_ceil(MINIMUM_AUDIO_BUFFER_TIME_MS / msecs) * 2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->numAudioBuffers = numAudioBuffers;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- this->hidden->audioBuffer = SDL_calloc(1, sizeof (AudioQueueBufferRef) * numAudioBuffers);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (this->hidden->audioBuffer == NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SDL_OutOfMemory();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -693,23 +717,29 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static void
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--COREAUDIO_ThreadInit(_THIS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+audioqueue_thread(void *arg)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_AudioDevice *this = (SDL_AudioDevice *) arg;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const int rc = prepare_audioqueue(this);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (!rc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- /* !!! FIXME: do this in RunAudio, and maybe block OpenDevice until ThreadInit finishes, too, to report an opening error */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_OpenedAudioDeviceDisconnected(this); /* oh well. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->thread_error = SDL_strdup(SDL_GetError());
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_SemPost(this->hidden->ready_semaphore);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static void
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--COREAUDIO_PrepareToClose(_THIS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--{
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- /* run long enough to queue some silence, so we know our actual audio
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- has been played */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- CFRunLoopRunInMode(kCFRunLoopDefaultMode, (((this->spec.samples * 1000) / this->spec.freq) * 2) / 1000.0f, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- AudioQueueStop(this->hidden->audioQueue, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* init was successful, alert parent thread and start running... */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_SemPost(this->hidden->ready_semaphore);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ while (!SDL_AtomicGet(&this->hidden->shutdown)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.10, 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!this->iscapture) { /* Drain off any pending playback. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const CFTimeInterval secs = (((this->spec.size / (SDL_AUDIO_BITSIZE(this->spec.format) / 8)) / this->spec.channels) / ((CFTimeInterval) this->spec.freq)) * 2.0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ CFRunLoopRunInMode(kCFRunLoopDefaultMode, secs, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static int
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -796,23 +826,28 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- /* Calculate the final parameters for this audio specification */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- SDL_CalculateAudioSpec(&this->spec);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (iscapture) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->capturestream = SDL_NewAudioStream(this->spec.format, this->spec.channels, this->spec.freq, this->spec.format, this->spec.channels, this->spec.freq);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (!this->hidden->capturestream) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return -1; /* already set SDL_Error */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->bufferSize = this->spec.size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- this->hidden->buffer = SDL_malloc(this->hidden->bufferSize);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (this->hidden->buffer == NULL) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return SDL_OutOfMemory();
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* This has to init in a new thread so it can get its own CFRunLoop. :/ */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_AtomicSet(&this->hidden->shutdown, 0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->ready_semaphore = SDL_CreateSemaphore(0);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!this->hidden->ready_semaphore) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return -1; /* oh well. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->thread = SDL_CreateThreadInternal(audioqueue_thread, "AudioQueue thread", 512 * 1024, this);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!this->hidden->thread) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_SemWait(this->hidden->ready_semaphore);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_DestroySemaphore(this->hidden->ready_semaphore);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ this->hidden->ready_semaphore = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if ((this->hidden->thread != NULL) && (this->hidden->thread_error != NULL)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ SDL_SetError("%s", this->hidden->thread_error);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return (this->hidden->thread != NULL) ? 0 : -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static void
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -832,12 +867,6 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- impl->OpenDevice = COREAUDIO_OpenDevice;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- impl->CloseDevice = COREAUDIO_CloseDevice;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- impl->Deinitialize = COREAUDIO_Deinitialize;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- impl->ThreadInit = COREAUDIO_ThreadInit;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- impl->WaitDevice = COREAUDIO_WaitDevice;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- impl->GetDeviceBuf = COREAUDIO_GetDeviceBuf;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- impl->PrepareToClose = COREAUDIO_PrepareToClose;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- impl->CaptureFromDevice = COREAUDIO_CaptureFromDevice;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- impl->FlushCapture = COREAUDIO_FlushCapture;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #if MACOSX_COREAUDIO
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- impl->DetectDevices = COREAUDIO_DetectDevices;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -847,6 +876,7 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- impl->OnlyHasDefaultCaptureDevice = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ impl->ProvidesOwnCallbackThread = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- impl->HasCaptureSupport = 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 1; /* this audio target is available. */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span></pre><pre style='margin:0'>
</pre>