Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions external/ALmixer/Isolated/LGPL/mpg123.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ static int MPG123_init(void);
static void MPG123_quit(void);
static int MPG123_open(Sound_Sample *sample, const char *ext);
static void MPG123_close(Sound_Sample *sample);
static Uint32 MPG123_read(Sound_Sample *sample);
static size_t MPG123_read(Sound_Sample *sample);
static int MPG123_rewind(Sound_Sample *sample);
static int MPG123_seek(Sound_Sample *sample, Uint32 ms);
static int MPG123_seek(Sound_Sample *sample, size_t ms);

/* !!! FIXME: MPEG and MPG extensions? */
static const char *extensions_mpg123[] = { "MP3", NULL };
Expand Down Expand Up @@ -133,9 +133,9 @@ static int MPG123_init(void)
assert(mpg123_mutex == NULL);
if (mpg123_init() == MPG123_OK)
{
char **supported = mpg123_supported_decoders();
print_decoders("ALL MPG123 DECODERS", mpg123_decoders());
print_decoders("SUPPORTED MPG123 DECODERS", mpg123_supported_decoders());
const char **supported = mpg123_supported_decoders();
print_decoders("ALL MPG123 DECODERS", (char **)mpg123_decoders());
print_decoders("SUPPORTED MPG123 DECODERS", (char **)mpg123_supported_decoders());
if ((supported != NULL) && (*supported != NULL))
{
mpg123_mutex = SDL_CreateMutex();
Expand Down Expand Up @@ -192,7 +192,7 @@ static const char *set_error(mpg123_handle *mp, const int err)

snprintf(buffer, sizeof (buffer), "MPG123: %s", str);
__Sound_SetError(buffer);

return(NULL); /* this is for BAIL_MACRO to not try to reset the string. */
} /* set_error */

Expand Down Expand Up @@ -347,7 +347,7 @@ static void MPG123_close(Sound_Sample *sample)
} /* MPG123_close */


static Uint32 MPG123_read(Sound_Sample *sample)
static size_t MPG123_read(Sound_Sample *sample)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
mpg123_t *mp = ((mpg123_t *) internal->decoder_private);
Expand Down Expand Up @@ -376,7 +376,7 @@ static int MPG123_rewind(Sound_Sample *sample)
} /* MPG123_rewind */


static int MPG123_seek(Sound_Sample *sample, Uint32 ms)
static int MPG123_seek(Sound_Sample *sample, size_t ms)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
mpg123_t *mp = ((mpg123_t *) internal->decoder_private);
Expand All @@ -390,4 +390,3 @@ static int MPG123_seek(Sound_Sample *sample, Uint32 ms)
#endif /* SOUND_SUPPORTS_MPG123 */

/* end of mpg123.c ... */

29 changes: 14 additions & 15 deletions external/ALmixer/Isolated/LGPL/oggtremor.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ static int OGG_init(void);
static void OGG_quit(void);
static int OGG_open(Sound_Sample *sample, const char *ext);
static void OGG_close(Sound_Sample *sample);
static uint32_t OGG_read(Sound_Sample *sample);
static size_t OGG_read(Sound_Sample *sample);
static int OGG_rewind(Sound_Sample *sample);
static int OGG_seek(Sound_Sample *sample, uint32_t ms);
static int OGG_seek(Sound_Sample *sample, size_t ms);

static const char *extensions_ogg[] = { "OGG", NULL };
const Sound_DecoderFunctions __Sound_DecoderFunctions_OGG =
Expand Down Expand Up @@ -184,7 +184,7 @@ static int OGG_open(Sound_Sample *sample, const char *ext)
rc = ov_open_callbacks(internal->rw, vf, NULL, 0, RWops_ogg_callbacks);
if (rc != 0)
{
#if (defined DEBUG_CHATTER)
#if (defined DEBUG_CHATTER)
SNDDBG(("OGG: can't grok data. reason: [%s].\n", ogg_error(rc)));
#endif
free(vf);
Expand All @@ -200,7 +200,7 @@ static int OGG_open(Sound_Sample *sample, const char *ext)
} /* if */

output_ogg_comments(vf);

SNDDBG(("OGG: bitstream version == (%d).\n", info->version));
SNDDBG(("OGG: bitstream channels == (%d).\n", info->channels));
SNDDBG(("OGG: bitstream sampling rate == (%ld).\n", info->rate));
Expand Down Expand Up @@ -249,7 +249,7 @@ static void OGG_close(Sound_Sample *sample)
} /* OGG_close */

/* Note: According to the Vorbis documentation:
* "ov_read() will decode at most one vorbis packet per invocation,
* "ov_read() will decode at most one vorbis packet per invocation,
* so the value returned will generally be less than length."
* Due to this, for buffer sizes like 16384, SDL_Sound was always getting
* an underfilled buffer and always setting the EAGAIN flag.
Expand All @@ -259,20 +259,20 @@ static void OGG_close(Sound_Sample *sample)
* However, there may still be some corner cases where the buffer
* cannot be entirely filled. So be aware.
*/
static uint32_t OGG_read(Sound_Sample *sample)
static size_t OGG_read(Sound_Sample *sample)
{
int rc;
int bitstream;
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
OggVorbis_File *vf = (OggVorbis_File *) internal->decoder_private;

rc = ov_read(vf, internal->buffer, internal->buffer_size,
&bitstream);

/* Make sure the read went smoothly... */
if (rc == 0)
sample->flags |= SOUND_SAMPLEFLAG_EOF;

else if (rc < 0)
sample->flags |= SOUND_SAMPLEFLAG_ERROR;

Expand Down Expand Up @@ -316,12 +316,12 @@ static uint32_t OGG_read(Sound_Sample *sample)
* is because the requested amount of data was smaller
* than the minimum packet size.
* For now, I will be conservative
* and not set the EOF flag, and let the next call to
* and not set the EOF flag, and let the next call to
* this function figure it out.
* I think the ERROR flag is safe to set because
* it looks like OGG simply returns 0 if the
* read size is too small.
* And in most cases for sensible buffer sizes,
* I think the ERROR flag is safe to set because
* it looks like OGG simply returns 0 if the
* read size is too small.
* And in most cases for sensible buffer sizes,
* this fix will fill the buffer,
* so we can set the EAGAIN flag without worrying
* that it will always be set.
Expand Down Expand Up @@ -363,7 +363,7 @@ static int OGG_rewind(Sound_Sample *sample)
} /* OGG_rewind */


static int OGG_seek(Sound_Sample *sample, uint32_t ms)
static int OGG_seek(Sound_Sample *sample, size_t ms)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
OggVorbis_File *vf = (OggVorbis_File *) internal->decoder_private;
Expand All @@ -376,4 +376,3 @@ static int OGG_seek(Sound_Sample *sample, uint32_t ms)


/* end of ogg.c ... */

11 changes: 5 additions & 6 deletions external/ALmixer/Isolated/LGPL/wav.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ static int WAV_init(void);
static void WAV_quit(void);
static int WAV_open(Sound_Sample *sample, const char *ext);
static void WAV_close(Sound_Sample *sample);
static uint32_t WAV_read(Sound_Sample *sample);
static size_t WAV_read(Sound_Sample *sample);
static int WAV_rewind(Sound_Sample *sample);
static int WAV_seek(Sound_Sample *sample, uint32_t ms);
static int WAV_seek(Sound_Sample *sample, size_t ms);

static const char *extensions_wav[] = { "WAV", NULL };
const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV =
Expand Down Expand Up @@ -246,7 +246,7 @@ typedef struct
{
uint32_t chunkID;

/* Johnson Lin wanted to clean up compiler warnings on Windows/CodeBlocks.
/* Johnson Lin wanted to clean up compiler warnings on Windows/CodeBlocks.
* This was originally a signed int32_t. The code usage and intent seems to imply that it should be a uint32_t.
*/
/* int32_t chunkSize; */
Expand Down Expand Up @@ -818,7 +818,7 @@ static void WAV_close(Sound_Sample *sample)
} /* WAV_close */


static uint32_t WAV_read(Sound_Sample *sample)
static size_t WAV_read(Sound_Sample *sample)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
wav_t *w = (wav_t *) internal->decoder_private;
Expand All @@ -838,7 +838,7 @@ static int WAV_rewind(Sound_Sample *sample)
} /* WAV_rewind */


static int WAV_seek(Sound_Sample *sample, uint32_t ms)
static int WAV_seek(Sound_Sample *sample, size_t ms)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
wav_t *w = (wav_t *) internal->decoder_private;
Expand All @@ -848,4 +848,3 @@ static int WAV_seek(Sound_Sample *sample, uint32_t ms)
#endif /* SOUND_SUPPORTS_WAV */

/* end of wav.c ... */

8 changes: 4 additions & 4 deletions external/mpg123-1.13.1/src/libmpg123/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "config.h"
#include "intsym.h"

#ifdef HAVE_STDLIB_H
#ifndef HAVE_STDLIB_H
/* realloc, size_t */
#include <stdlib.h>
#endif
Expand All @@ -33,7 +33,7 @@
#endif
#endif

#ifdef HAVE_UNISTD_H
#ifndef HAVE_UNISTD_H
#include <unistd.h>
#endif

Expand All @@ -52,15 +52,15 @@
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif

#ifndef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
#endif
#ifndef ULONG_MAX
#define ULONG_MAX ((unsigned long)-1)
#endif

#ifdef HAVE_STRING_H
#ifndef HAVE_STRING_H
#include <string.h>
#endif

Expand Down