Commit graph

395 commits

Author SHA1 Message Date
David Ludwig
a1ef55a6f7 WinRT: added Windows Phone 8 project files, and got SDL compiling under them 2013-01-28 23:13:07 -05:00
David Ludwig
cc456a7516 WinRT: added a note to try removing some WinRT-specific code from SDL_xaudio2.c 2012-12-30 13:03:45 -05:00
David Ludwig
0b7cfac19e WinRT: fixed XAudio2 crash bug + enabled XAudio2 backend 2012-12-30 12:57:33 -05:00
David Ludwig
643b3f0a30 WinRT: merged with the latest official SDL source 2012-12-16 22:02:01 -05:00
Sam Lantinga
3899bd164f Fixed permissions for code generation scripts 2012-12-11 12:01:04 -08:00
David Ludwig
6e713b5e0f WinRT: fixed Win32 compile error in XAudio2 backend 2012-11-25 14:45:22 -05:00
David Ludwig
be90b123c3 WinRT: got XAudio2 sort-of working (it plays stuff poorly, then crashes) 2012-11-24 11:19:06 -05:00
David Ludwig
c4d055488f WinRT: got the XAudio2 backend compiling (but not running, yet) 2012-11-22 22:34:50 -05:00
Sam Lantinga
6f52124aad Fixed bug 1632 - iOS CoreAudio doesn't close
C.W. Betts 2012-10-28 19:42:01 PDT

I noticed when looking through the CoreAudio code of SDL 2.0 that there was a
fix me wondering how iOS closed the audio system. While working on my own audio
code on PlayerPRO, I discovered that Carbon's component code was replaced in
the audio subsystem with Audio Component Services.
2012-11-02 09:28:40 -07:00
Sam Lantinga
68ee3bad84 Allow playing iPod music in the background of SDL applications.
You can always change your audio session category afterwards if you want custom behavior.
2012-11-01 19:08:12 -07:00
Sam Lantinga
f380ecb137 Removed executable bit from source files 2012-09-27 14:35:28 -07:00
Sam Lantinga
d2b7ba63d1 NetBSD patch to use AUDIO_GETBUFINFO when available (contributed by jmcneill) 2012-09-25 20:47:38 -07:00
Ryan C. Gordon
5c732d6324 Removed Windows CE support from SDL 2.0.
It's a long-dead platform, and we don't have any way to build for, test, or
maintain it, so there's no sense in doing acrobatics to support it.

If you need Windows CE support, use SDL 1.2. If you need Windows Phone support,
send SDL 2.0 patches for the newer Windows Mobile platform.
2012-09-15 10:59:39 -04:00
Ryan C. Gordon
bd6eef53b6 Removed a FIXME; RemoteIO is correct for iOS.
--HG--
extra : rebase_source : b7707b74bcdcafe4165a8c6eb7982c23fb2b9d0e
2012-09-02 19:37:36 -04:00
Ryan C. Gordon
a4a3cff536 Fixed compiler warning. 2012-08-30 12:58:58 -07:00
Ryan C. Gordon
8912814135 Removed some unused variables that gcc 4.6.1 complains about. 2012-08-09 14:14:41 -04:00
Sam Lantinga
7b6f9ccd63 Removed unneeded audio buffer memset() for consistent behavior on all platforms. 2012-07-05 12:16:44 -04:00
Ryan C. Gordon
df8784cd61 Replaced some assert macros with SDL_assert. 2012-02-07 02:11:15 -05:00
Sam Lantinga
3fe05cfb55 Better interpolation for the x4 upsampling case 2012-01-12 22:54:09 -05:00
Sam Lantinga
17d38b0d37 Fixed issue where there was a garbage sample at the end of the buffer. 2012-01-12 21:42:35 -05:00
Sam Lantinga
d3d897c6d0 Fixed memory corruption in the upsampling code, caught by valgrind 2012-01-08 17:31:11 -05:00
Sam Lantinga
7e2e5d34e6 Fixed bug 1091 - Hardcoded size in SDL_audiocvt.c may lead to heap/stack corruption
Markovtsev Vadim 2011-01-18 22:00:16 PST

SDL_audiocvt.c:

static void SDLCALL
SDL_ConvertStereo(SDL_AudioCVT * cvt, SDL_AudioFormat format):

#define dup_chans_1_to_2(type) \
    { \
        const type *src = (const type *) (cvt->buf + cvt->len_cvt); \
        type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \
        for (i = cvt->len_cvt / 2; i; --i, --src) { \
            const type val = *src; \
            dst -= 2; \
            dst[0] = dst[1] = val; \
        } \
    }

Pay attention to cvt->len_cvt / 2. 2 is the sizeof(Uint16), hovewer, below we
see that the conversion function supports Uint8 and Uint32:

switch (SDL_AUDIO_BITSIZE(format)) {
    case 8:
        dup_chans_1_to_2(Uint8);
        break;
    case 16:
        dup_chans_1_to_2(Uint16);
        break;
    case 32:
        dup_chans_1_to_2(Uint32);
        break;
    }

If type is Uint32, src will be decreased twice as it should be, memory being
written before the cvt->buf. If type is Uint8, the conversion will not be
complete. I suggest to change that define to

#define dup_chans_1_to_2(type) \
    { \
        const type *src = (const type *) (cvt->buf + cvt->len_cvt); \
        type *dst = (type *) (cvt->buf + cvt->len_cvt * 2); \
        for (i = cvt->len_cvt / sizeof(type); i; --i, --src) { \
            const type val = *src; \
            dst -= 2; \
            dst[0] = dst[1] = val; \
        } \
    }

I tested that and now it's working fine. I did not consider the similar defines
in functions nearby.
2012-01-08 17:20:33 -05:00
Sam Lantinga
a9bcdb83a9 Fixed bug 1014 - SDL_ConvertAudio crashes
The patch Mark attached looks good and valgrind gives it a clean bill of health:

Mark.Howson@ntu.ac.uk 2010-12-15 07:45:25 PST

Reproducible here under Windows and Linux. Looking at the code for
SDL_Upsample_S16LSB_2c:

const int dstsize = (int) (((double)cvt->len_cvt) * cvt->rate_incr);
Sint16 *dst = ((Sint16 *) (cvt->buf + dstsize)) - 2;
const Sint16 *target = ((const Sint16 *) cvt->buf) - 2;
while (dst > target) {
   dst[1] = ((Sint16) SDL_SwapLE16(sample1));
   dst[0] = ((Sint16) SDL_SwapLE16(sample0));
   dst -= 2;
...

if dstsize is odd (and therefore dst), it'll write to target[1] which is one
byte before the allocated buf.

The attached patch to sdlgenaudiocvt.pl changes dst > target to dst >= target,
and removes the - $channels for the upsample case. The patch is not fully
tested, but seems to work here.
2012-01-08 17:10:57 -05:00
Sam Lantinga
bc63cb4ee4 Fixed bug 1362 - SDL Fails to compile with Visual C++ Express 2008 with Feb 2007 DirectX SDK
Pallav Nawani 2012-01-04 00:48:29 PST
Issue:
Attempted to compile SDL as a static library.

DirectX SDK: Feb 2007
OS: Win 7
Visual C++ Express 2008
Compliation Mode: Static (Changed project settings from dll to lib)

Error:
C1021: invalid preprocessor command 'warning'

It seems that the #warning directive does not exist in Vc++ Express 2008.
2012-01-07 00:57:24 -05:00
Ryan C. Gordon
5fa2cb67e2 Use arts_suspend() in a loop to wait for arts to become ready.
(Transplanted from hg changeset 331f27f01cdb to the 1.3 branch.)
2012-01-02 15:16:45 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Ryan C. Gordon
4220f125c3 Fixed some preprocessor mistakes introduced in iOS project cleanup. 2011-11-03 11:51:47 -04:00
Sam Lantinga
ad2a21d404 Lots of fixes importing SDL source wholesale into a new iOS project
--HG--
rename : src/libm/math.h => src/libm/math_libm.h
2011-10-31 05:56:58 -04:00
Ryan C. Gordon
f2923fca25 Commit updated generated C code. 2011-10-11 22:42:54 -04:00
Ryan C. Gordon
cc8e8dea00 Fixed compiler warning for unused variable in generated C code. 2011-10-11 22:35:19 -04:00
Ryan C. Gordon
aac491ccac Fixed perl string escaping thing. 2011-10-11 22:34:52 -04:00
Ryan C. Gordon
0863dee582 1.3 API CHANGE: Add support for naming threads.
--HG--
extra : rebase_source : ae532d4b4d68ef86de0fc2cb6794a622e0841bce
2011-10-02 00:29:16 -04:00
Ryan C. Gordon
131470867d Replaced a sanity check with an SDL_assert(). 2011-09-21 02:42:25 -04:00
Ryan C. Gordon
f77b7f703a Fixed a compiler warning. 2011-09-09 04:48:45 -04:00
Ryan C. Gordon
0daed19a0e Removed the MAC_OS_X_VERSION_10_x macros from the 1.3 branch. 2011-08-25 03:11:28 -04:00
Ryan C. Gordon
1ea43749bd Cleaned out functions deprecated in Mac OS X 10.6 SDK. 2011-08-23 15:17:44 -04:00
Ryan C. Gordon
5df7568eec Further XAudio2 build test cleanups. 2011-08-22 14:56:46 -04:00
Ryan C. Gordon
6412a3147e Removed SDL_xaudio2.h ... no real need for this to be separate. 2011-08-22 14:37:45 -04:00
Ryan C. Gordon
023503370c Let XAudio2 target be removed from the build by removing it from SDL_config.h 2011-08-22 14:30:49 -04:00
Ryan C. Gordon
98babc2004 Ported ALSA minimum-sample-count fix from 1.2 branch to 1.3. 2011-08-21 11:52:21 -04:00
Ryan C. Gordon
40480fb3c4 Make sure XAudio2 is supported by the DirectX headers at compile time.
--HG--
extra : rebase_source : a461903e0d9d4334a29cb0c9848a36f268d8f0e6
2011-08-21 02:35:13 -04:00
Ryan C. Gordon
0463ea420b Patched to compile on Mac OS X. 2011-08-06 02:15:23 -04:00
Ryan C. Gordon
2c03d6f4e6 Patched to compile on Linux.
(Grumble grumble, should have tested better after all the history editing...)
2011-08-05 00:48:56 -04:00
Ryan C. Gordon
67740a37fa Patched to compile. 2011-08-04 19:33:45 -04:00
Ryan C. Gordon
e42ca42e76 Removed some Windows endlines. 2011-08-04 01:36:23 -04:00
Ryan C. Gordon
b2540abd8e Merged Mac OS X and iOS audio targets.
--HG--
rename : src/audio/macosx/SDL_coreaudio.c => src/audio/coreaudio/SDL_coreaudio.c
rename : src/audio/macosx/SDL_coreaudio.h => src/audio/coreaudio/SDL_coreaudio.h
2011-08-04 00:45:09 -04:00
Ryan C. Gordon
cd8da3097b Removed no-op Deinitialize methods in audio drivers. 2011-07-26 14:20:22 -07:00
Ryan C. Gordon
b4cf784f88 Removed needless macros in various audio targets. 2011-07-26 14:18:00 -07:00
Ryan C. Gordon
8e6153c36b Cleaned up audio device detection. Cleared out a lot of cut-and-paste. 2011-08-04 00:31:11 -04:00
Ryan C. Gordon
46bb3d8770 Implemented XAudio2 target for Windows (and Xbox360, theoretically!). 2011-08-04 01:07:09 -04:00