Commit Graph

56 Commits

Author SHA1 Message Date
Sam Lantinga
a9072159b2 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Ryan C. Gordon
3e35871488 audio: fixed typo in Doxygen comment. 2017-12-09 03:24:01 -05:00
Sam Lantinga
1e63db4504 Document the SDL audio channel mapping 2017-10-20 14:48:10 -07:00
Sam Lantinga
ff2da1f583 Added SDL_AudioStreamFlush() to the list of new audio stream functions 2017-10-20 10:45:38 -07:00
Ryan C. Gordon
ba79be8ef6 audio: Added SDL_AudioStreamFlush(). 2017-10-19 18:05:42 -04:00
Sam Lantinga
34f15d9394 Added audio stream conversion functions:
SDL_NewAudioStream
    SDL_AudioStreamPut
    SDL_AudioStreamGet
    SDL_AudioStreamAvailable
    SDL_AudioStreamClear
    SDL_FreeAudioStream
2017-10-18 15:54:05 -07:00
Sam Lantinga
c768e01da0 Updated documentation, you don't need to initialize the audio subsystem to do in-place format conversion. (Thanks Simon Hug!) 2017-08-29 09:02:04 -07:00
Ryan C. Gordon
10c92a0193 audio: better docs on conversion APIs, error if not init'd (thanks, Simon!).
Fixes Bugzilla #3662.
2017-08-18 16:52:19 -04:00
Sam Lantinga
ba66a89116 Fixed bug 3668 - Overflow of SDL_AudioCVT.filters with some downmixes
Simon Hug

There's a chance that an audio conversion from many channels to a few can use more than 9 audio filters. SDL_AudioCVT has 10 SDL_AudioFilter pointers of which one has to be the terminating NULL pointer. The SDL code has no checks for this limit. If it overflows there can be stack or heap corruption or a call to 0xa.

Attached patch adds a function that checks for this limit and throws an error if it is reached. Also adds some documentation.

Test parameters that trigger this issue:
AUDIO_U16MSB with 224 channels at 46359 Hz
                 V
AUDIO_S16MSB with 6 channels at 27463 Hz

The fuzzer program I uploaded in bug 3667 has more of them.
2017-06-12 16:39:15 -07:00
Ryan C. Gordon
05df03613b audio: clarified what SDL_AudioSpec::samples is, removed note about power of 2.
These don't have to be power-of-2 sizes anymore because of SDL_AudioStream,
and the new resampler, but also, many platforms don't give you power-of-2 DMA
buffer in the first place!
2017-02-27 10:11:40 -05:00
Ryan C. Gordon
0a8fc77425 Added a note about aligning SDL_AudioCVT data. 2017-01-24 00:55:41 -05:00
Sam Lantinga
d77ab77a7a Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
9cc7ce9008 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Ryan C. Gordon
4d927d82ed audio: Implemented buffer queueing for capture devices (SDL_DequeueAudio()). 2016-08-06 02:47:27 -04:00
Sam Lantinga
255c182471 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Ryan C. Gordon
01187b701d Added audio device buffer queueing API. 2014-07-22 21:41:49 -04:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Gabriel Jacobo
8515791f86 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
871473e032 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Ryan C. Gordon
77b4978afb Removed function signature that doesn't actually exist yet. 2013-08-06 18:23:46 -07:00
Sam Lantinga
a804c33317 Fixed stack smashing crash when using the GCC compiled DLL with Visual Studio. 2013-07-29 23:28:25 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
128821901c Removing some more references to SDL 1.3 2012-01-22 17:26:45 -05:00
Sam Lantinga
e256711bb9 Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
6196aa221e SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
a2cdcf5486 Happy 2011! :) 2011-02-11 22:37:15 -08:00
Sam Lantinga
7052036491 Fixed bug #926
Updated copyright to LGPL version 2.1 and year 2010
2010-01-24 21:10:53 +00:00
Sam Lantinga
ed8e1e54ad Name the audio callback for documentation clarity. 2009-12-13 06:21:22 +00:00
Sam Lantinga
dd8238d718 Switch to mixed case for consistency with other enumerations 2009-12-10 08:28:26 +00:00
Sam Lantinga
27294b7a4e Partial fix for bug #859
Header file update from Ken for improved doxygen output
2009-10-19 13:31:58 +00:00
Ryan C. Gordon
7b1b655f97 First shot at new audio resampling code. 2009-01-11 04:46:42 +00:00
Sam Lantinga
c5a8886195 Fixed SDL 1.2 compatibility problem.
The API specifies that SDL_OpenAudio() will fill out the 'desired' audio spec
with the correct samples and size set by the driver.  This value is important
since it may be used by applications that size audio buffers, etc.

However, we want to allow advanced applications to call SDL_OpenAudioDevice()
which gets passed a const 'desired' parameter, and have the correct data filled
into the 'obtained' parameter, possibly allowing or not allowing format changes.

So... 'obtained' becomes the audio format the user callback is expected to use,
and we add flags to allow the application to specify which format changes are
allowed.

Note: We really need to add a way to query the 'obtained' audio spec.
2008-12-13 06:36:47 +00:00
Sam Lantinga
befb0f7f42 Updated copyright date 2008-12-08 00:27:32 +00:00
Sam Lantinga
f74840152b Fixed compile errors for audio resampling. I'm not sure how this got missed... 2008-08-26 02:26:18 +00:00
Ryan C. Gordon
7f17eb8863 Merged SDL-ryan-multiple-audio-device branch r2803:2871 into the trunk. 2006-10-17 09:15:21 +00:00
Sam Lantinga
7462d2796b Added source color and alpha modulation support.
Added perl script to generate optimized render copy functions.
2006-08-28 03:17:39 +00:00
Ryan C. Gordon
2de95c23ba Forgot to check in updated SDL_audio.h ... 2006-08-24 12:48:16 +00:00
Sam Lantinga
b59f1d5aff In general, fill in pointers to structures, rather than return them. 2006-08-05 22:34:23 +00:00
Ryan C. Gordon
13894e5028 1.3 API proposals for audio subsystem. Nothing in here is guaranteed to
stay as-is! And none of it is implemented yet!

 Use at own risk!
2006-08-03 19:34:05 +00:00
Sam Lantinga
6bc598ea61 SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head. 2006-07-10 21:04:37 +00:00
Sam Lantinga
769424426d More header massaging... works great on Windows. ;-) 2006-02-10 06:48:43 +00:00
Sam Lantinga
5022a01e6c *** empty log message *** 2006-02-10 03:19:02 +00:00
Sam Lantinga
8df54cd371 Started the process of improving configure support, and merging C types
and library support into a single header.
2006-02-09 09:07:13 +00:00
Sam Lantinga
82bfaee73a It's now possible to build SDL without any C runtime at all on Windows,
using Visual C++ 2005
2006-02-06 08:28:51 +00:00
Sam Lantinga
808a16717c Updated copyright information and removed rcs id lines (problematic in branch merges)
I batch edited these files, so please let me know if I've accidentally removed anybody's
credit here.
2006-02-01 06:32:25 +00:00
Sam Lantinga
c6c5bee36f Date: Fri, 20 Aug 2004 08:31:20 +0200
From: "Markus F.X.J. Oberhumer"
Subject: [SDL-CVS][patch] add missing SDLCALL to headers

the small patch attached below (against current CVS) adds some missing SDLCALL
decorations to callback types and arguments.

Unfortunately one of these changes breaks your gen{def,exp}.pl scripts which
should be changed to use non-greedy regular expression matching...
2004-08-20 18:57:01 +00:00
Sam Lantinga
08c158c94b Date: Mon, 3 May 2004 03:15:01 +0100
From: David Symmonds
Subject: SDL Typedef Structs

Hi, Thanks for the SDL libraries, I have been using them for about a year
now and they are really brilliant. One thing that I have just found whilst
using them through C++ (and needing forward declarations) is that when you
typedef structs you sometimes use

typedef struct Name
{
...
}Name;

e.g. SDL_Surface


and other times use

typedef struct
{
...
}Name;


e.g. SDL_Rect

The first type works fine, when I define a header file I can just put
'struct Name;' at the top and use the Name throughout. However, the second
type is harder to use in a header, and I haven't found a way yet, other than
to include 'SDL.h' in the header file (undesirable). Would there be any harm
in changing the definition of SDL_Rect and such like to the second form?
2004-07-18 22:57:40 +00:00
Sam Lantinga
32719e7429 Updated copyright information for 2004 (Happy New Year!) 2004-01-04 16:49:27 +00:00