summaryrefslogtreecommitdiff
path: root/src/i_sdlsound.c
AgeCommit message (Collapse)Author
2015-05-08warnings: fix "variable ‘..’ set but not used" warningsFabian Greffrath
Fixed by commenting out the reported variables and their settings instead of removing them. Since I am not sure if they were added by mistake or by purpose and then overseen, I think it's better to keep them in the code but not compile them in for now.
2014-08-16Warning fixes (23 remain...)James Haley
2014-05-05Clean up file headers.Simon Howard
This change rewrites and simplifies the copyright headers at the top of all source files: * Remove "Emacs style mode select" line; this line was included in the headers for the originally released source files and appears to be to set the file type for old versions of Emacs. I'm not sure entirely why it was required but I don't think it is any more. * Remove "You should have received a copy of..." text from copyright header. This refers to the old 59 Temple Place address where the FSF headquarters used to be located and is no longer correct. Rather than change to the new address, just remove the paragraph as it is superfluous anyway. This fixes #311. * Remove ---- separator lines so that the file headers are barer and more simplified.
2014-04-10sound: Fix crash with large values of snd_channels.Simon Howard
Sanity check the handles passed to the i_sdlsound.c API functions and ignore requests that involve channel numbers higher than 15. This fixes a crash if the user sets the snd_channels config variable is set to a high value. This fixes #149 (thanks Alexandre Xavier).
2014-04-01Replace all snprintf() calls with M_snprintf().Simon Howard
The Windows API has an _snprintf function that is not the same as Unix's snprintf(): if the string is truncated then no trailing NUL character is appended. This makes the function unsafe. Define a replacement/wrapper called M_snprintf that works the same but always appends a trailing NUL, for safety on Windows and other OSes that behave like this. Do the same thing for vsnprintf(), and update HACKING to list snprintf/vsnprintf as forbidden functions. This fixes #375; thanks to Quasar for pointing out the different behavior of these functions.
2014-03-30sound: Fix compile when using libsamplerate.Simon Howard
The change in commit 62b5c6028.. broke the compile.
2014-03-30Eliminate some uses of sprintf() from common code.Simon Howard
As part of this, add DIR_SEPARATOR_S as a string version of the DIR_SEPARATOR macro. Change M_TempFile() to return a string allocated on the C heap rather than the zone heap. This is a first step towards fixing #371.
2014-03-29misc: Add string utility functions.Simon Howard
It's more readable to write "M_StringEndsWith(..." than doing a bunch of pointer arithmetic, and this is a common pattern. Also add M_StringStartsWith, M_StringJoin and M_StringCopy. The latter is a safe alternative for strcpy() that works the same as OpenBSD's strlcpy(). Use these functions in a few places where it makes sense.
2014-03-23sound: Add config variable to control buffer size.Simon Howard
Add snd_maxslicetime_ms variable to control the size of the output sound buffer, and reduce the default from 70ms to 28ms to match Doom's 35fps timer. Thanks to Holering for reporting this (fixes #345).
2013-09-29Add config file variable for controlling libsamplerate conversion scaleSimon Howard
factor. This is an alternative to the approach taken in the version on the trunk version, where all sounds are pre-converted at startup and adjusted based on the maximum value. Subversion-branch: /branches/v2-branch Subversion-revision: 2690
2011-09-12Fix bug in doubly-linked list implementation.Simon Howard
Subversion-branch: /branches/strife-branch Subversion-revision: 2368
2011-03-06Merge from raven-branch.Simon Howard
Subversion-branch: /branches/strife-branch Subversion-revision: 2293
2011-03-06Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 2292
2011-03-06Discard very short sound effects and strip lead-in / lead-out samplesSimon Howard
that apparently aren't played by Vanilla Doom (thanks Quasar). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2291
2011-03-05Add configuration parameter to limit the amount of memory used forSimon Howard
cached soundss. Subversion-branch: /branches/strife-branch Subversion-revision: 2290
2011-03-05Behave correctly when we run out of memory.Simon Howard
Subversion-branch: /branches/strife-branch Subversion-revision: 2289
2011-02-28Rework sound chunk allocation to use native malloc() instead of the zoneSimon Howard
memory system. This should fix the problems with running out of memory when playing the long Strife voice sounds. Subversion-branch: /branches/strife-branch Subversion-revision: 2285
2010-12-10Merge from trunk. This is slightly out of date as I did the mergeSimon Howard
several days ago. Subversion-branch: /branches/raven-branch Subversion-revision: 2212
2010-11-24Add workaround to stop freezeups with old versions of SDL_mixer.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2165
2010-08-31Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1987
2010-08-07Change back filter frequency. Add debug code to dump resampled soundSimon Howard
effects to WAV files. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1952
2010-08-07Fix sound resampling low pass filter.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1951
2009-11-21Auto-select SDL slice size based on sample rate.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1739
2009-11-21Merge from trunk.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1737
2009-09-30Change British English spellings to American English, for consistency.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1699
2009-09-06Fixes for MSVC compile (thanks entryway).Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1657
2009-07-12Fix compile with libsamplerate.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1620
2009-05-17Always use an SDL buffer size that is a power of two. Reduce buffer sizeSimon Howard
to 70ms. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1524
2009-05-07Calculate SDL buffer size automatically based on sample rate.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1511
2009-03-15Fix clipped sounds when using libsamplerate (thanks David Flater)Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1479
2008-12-01Add missing header includes.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1398
2008-10-08Switch configuration file code to common configuration file code, andSimon Howard
remove old code. Subversion-branch: /branches/raven-branch Subversion-revision: 1338
2008-09-25Move GetSfxLumpName to shut up warningsSimon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1283
2008-09-25Add option to low-level sound API to disable the DS prefix for soundSimon Howard
effects, for Heretic. Fix sound links. Subversion-branch: /branches/raven-branch Subversion-revision: 1281
2008-09-14Allocate sound chunks and their buffers together, so that they are freedSimon Howard
out as cache together. Subversion-branch: /branches/raven-branch Subversion-revision: 1230
2008-09-14Remove i_sdlsound.c dependency on doom/Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1229
2008-09-11Add missing i_sound.h include.Simon Howard
Subversion-branch: /branches/raven-branch Subversion-revision: 1223
2008-09-08Split off some of the s_sound.c code into i_sound.c and reimplement theSimon Howard
old low-level sound API as a thin wrapper around the module system. Decouple the low-level code from the high-level code. Subversion-branch: /branches/raven-branch Subversion-revision: 1212
2008-09-07Move dehacked code to doom/. Split dehacked string replacement code intoSimon Howard
common code and remove dependencies on deh_main.h. Subversion-branch: /branches/raven-branch Subversion-revision: 1210
2008-09-06Remove includes of doomdef.h where possible, move generic parts into topSimon Howard
level. Subversion-branch: /branches/raven-branch Subversion-revision: 1204
2008-05-02Add W_CacheLumpNum,Name API to WAD code for releasing a lump back toSimon Howard
cache when it is no longer needed. Switch existing code to use the new API instead of Z_ChangeTag. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1134
2008-04-19Fix build problem when libsamplerate support is enabled.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1124
2008-04-19Fix some more warnings.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1121
2008-04-15Make use_libsamplerate be an integer value that controls conversionSimon Howard
quality, rather than an on/off setting. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1112
2008-03-13Display a warning message if use_libsamplerate != 0, but libsamplerateSimon Howard
support is not compiled in. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1106
2008-03-13Apply SRC patch from David Flater.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1105
2008-02-28Add fixes for MSVC warnings (thanks entryway).Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1095
2008-02-23Perform a low-pass filter of converted sounds to filter outSimon Howard
high-frequency noise from the upscaling process. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1088
2008-02-13Don't try to precache sound effects that don't exist.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1085
2008-02-12Add comment.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1084