Skip to content

Commit

Permalink
Bugfix (thanks Tsuyoshi Iguchi!), and Ogg Vorbis decoder entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 19, 2001
1 parent 1ba77b1 commit e1066b0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions SDL_sound.c
Expand Up @@ -52,6 +52,10 @@ extern const Sound_DecoderFunctions __Sound_DecoderFunctions_MP3;
extern const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV;
#endif

#if (defined SOUND_SUPPORTS_OGG)
extern const Sound_DecoderFunctions __Sound_DecoderFunctions_OGG;
#endif

#if (defined SOUND_SUPPORTS_VOC)
extern const Sound_DecoderFunctions __Sound_DecoderFunctions_VOC;
#endif
Expand All @@ -70,6 +74,10 @@ static const Sound_DecoderFunctions *decoderFuncs[] =
&__Sound_DecoderFunctions_WAV,
#endif

#if (defined SOUND_SUPPORTS_OGG)
&__Sound_DecoderFunctions_OGG,
#endif

#if (defined SOUND_SUPPORTS_VOC)
&__Sound_DecoderFunctions_VOC,
#endif
Expand Down Expand Up @@ -114,14 +122,15 @@ int Sound_Init(void)
for (i = 0; decoderFuncs[i] != NULL; i++)
; /* do nothing. */

i++;
available_decoders = (const Sound_DecoderInfo **)
malloc(i * sizeof (Sound_DecoderInfo *));
malloc((i + 1) * sizeof (Sound_DecoderInfo *));
BAIL_IF_MACRO(available_decoders == NULL, ERR_OUT_OF_MEMORY, 0);

for (i = 0; decoderFuncs[i] != NULL; i++)
available_decoders[i] = &decoderFuncs[i]->info;

available_decoders[i] = NULL;

initialized = 1;
return(1);
} /* Sound_Init */
Expand Down

0 comments on commit e1066b0

Please sign in to comment.