1
0
Fork 0
Commit graph

28 commits

Author SHA1 Message Date
krcroft
8f2a153dc2 STB Vorbis: eliminate inaccessible branch
The eliminated code removes the (ch == 1) branch, which is scoped
within this if condition: `if (rtype == 2 && ch != 1)`, therefore
the (ch == 1) branch will never be taken.
2019-12-05 10:35:44 +01:00
krcroft
a7a899fdb0 STB Vorbis: prevent division by zero in decode_resign if ch == 0
In the call to decode_residue:
  decode_residue(f, residue_buffers, ch, n2, r, do_not_decode);

The channel count is previously intialized as zero and incremented
based on a for-loop (f->channels) plus a conditional,
if (map->chan[j].mux == i).  If this doesn't happen then 'ch'
remains zero.

Once inside decode_residue(..), the code has three branches based
on channel count: stereo (ch == 2), mono (ch == 1), and then the
exception if it's neither of those (simple 'else').  It's in here
where a zero-valued 'ch' can be used as the denominator in these
calculations:
    int c_inter = z % ch
    p_inter = z/ch;

Obviously this 'else' branch is meant for channel counts greater
than two an not for zero channels; so this change simply makes
that branch only valid if (ch > 2).
2019-12-05 10:35:44 +01:00
krcroft
bedcc244d9 STB Vorbis: Check before derefercing a potential NULL pointer 2019-12-05 10:35:44 +01:00
David Reid
84588c50bd Bump dr_wav to v0.11.2
Fixes:
- https://github.com/mackron/dr_libs/issues/84
- https://github.com/mackron/dr_libs/issues/83
- https://github.com/mackron/dr_libs/issues/82
- https://github.com/mackron/dr_libs/issues/81
- https://github.com/mackron/dr_libs/issues/80
- https://github.com/mackron/dr_libs/issues/79
- https://github.com/mackron/dr_libs/issues/78
- https://github.com/mackron/dr_libs/issues/77
- https://github.com/mackron/dr_libs/issues/76
- https://github.com/mackron/dr_libs/issues/75
2019-12-03 06:35:00 +01:00
David Reid
6b5a5acc9a Bump dr_mp3 to v0.5.4
Fixes:
- https://github.com/mackron/dr_libs/issues/86
- https://github.com/mackron/dr_libs/issues/85
2019-12-03 06:35:00 +01:00
David Reid
1866b4d295 Bump dr_flac to v0.12.3
Fixes:
- https://github.com/mackron/dr_libs/issues/93
- https://github.com/mackron/dr_libs/issues/92
- https://github.com/mackron/dr_libs/issues/91
- https://github.com/mackron/dr_libs/issues/90
- https://github.com/mackron/dr_libs/issues/89
- https://github.com/mackron/dr_libs/issues/88
- https://github.com/mackron/dr_libs/issues/87
2019-12-03 06:35:00 +01:00
krcroft
1f2ff70463 Ensure alloca is not defined before defining 2019-12-03 06:35:00 +01:00
krcroft
01a61a33f8 Remove ineffective consts and indicate unused variables 2019-12-03 06:35:00 +01:00
krcroft
9892c1722a Remove SpeexDSP from the auto-tools configuraiton 2019-11-12 08:17:09 +01:00
krcroft
5a9dd2866b
Refactor and pass-through the decode buffer 2019-11-11 13:27:19 -08:00
krcroft
83e1979f26
Eliminate buffers, conversions, and unused code 2019-11-11 13:20:11 -08:00
David Reid
3d8dceee57
Bump dr_mp3 codec to v0.5.2 2019-11-11 13:16:22 -08:00
krcroft
dfc9b2db31 Add the audio handling changes to build system and documentation 2019-11-06 05:47:03 +01:00
krcroft
fd695b0948 Cleanup comments and NULL-handling in decoders 2019-11-06 05:15:42 +01:00
krcroft
b932a89f87
Adapt the vorbis library to SDL_Sound's needs 2019-11-05 17:21:39 -08:00
krcroft
f39b51fa78 Add SDL decoders for their corresponding codecs 2019-11-02 19:27:36 +01:00
krcroft
1f193e14ab Simplify the task of making bit-field operations C and C++ compatible 2019-10-28 22:43:23 +01:00
krcroft
5736a7de9b Make comment match reality 2019-10-28 22:43:23 +01:00
krcroft
b99184d97e Replace SDL_RWFromMem with more applicable SDL_RWFromConstMem 2019-10-28 22:43:23 +01:00
krcroft
d9658b4788 Replace strncpy with snprintf 2019-10-28 22:43:23 +01:00
krcroft
d2333979cf Tailor SDL_Sound for interal use by DOSBox
- Removes extraneous (and unused) includes

 - Cleans up many compiler warnings

 - Fixes SDL include statements (using proper `#include <file.h>` directives
   given the prior `#include "file.h"` directives should only be used when
   including a projects' own header files instead of -Ipath-provided system
   headers)

 - Eliminates extraneous codecs

Many of these were made after building SDL_Sound under various compilers
and operating systems and hitting various issues. It currently builds
clean without errors or warnings on all our workflow compilers and
versions.
2019-10-28 22:43:23 +01:00
Ryan C. Gordon
0420181d59 Add built-in SDL_sound r599
This commit contains several files imported from SDL_sound Mercurial
repo: https://hg.icculus.org/icculus/SDL_sound/ r599 (also tagged as
"final-lgpl-revision").
2019-10-26 06:55:13 +02:00
Arthur Ouellet
db67ff2e3b Add built-in C++ object serializer [snapshot as of 2019-10-23] 2019-10-25 00:47:43 +02:00
Yann Collet
28cf402cae Add built-in Extremely Fast Hash algorithm: xxHash [snapshot as of 2019-10-23] 2019-10-25 00:47:43 +02:00
Sean Barrett
fd5aeab8b5 Add built-in Vorbis codec: stb_vorbis v1.17 2019-10-25 00:47:43 +02:00
David Reid
d66317a08e Add built-in WAV codec: dr_wav v0.11.1 2019-10-25 00:47:43 +02:00
David Reid
a5f1e3473f Add built-in MP3 codec: dr_mp3 v0.5.1 2019-10-25 00:47:43 +02:00
David Reid
a5d87fa8ce Add built-in FLAC codec: dr_flac v0.12.2 2019-10-25 00:47:43 +02:00