# HG changeset patch # User Ryan C. Gordon # Date 1000810683 0 # Node ID cc2c323493805e9b4a7e5bdb17136e2ea1037f60 # Parent 2606137cf481bbfc2709d841392b95d3a218a05a Some debugging output, and MP3 and VOC entries, added. diff -r 2606137cf481 -r cc2c32349380 SDL_sound.c --- a/SDL_sound.c Tue Sep 18 10:56:36 2001 +0000 +++ b/SDL_sound.c Tue Sep 18 10:58:03 2001 +0000 @@ -44,6 +44,10 @@ /* The various decoder drivers... */ +#if (defined SOUND_SUPPORTS_MP3) +extern const Sound_DecoderFunctions __Sound_DecoderFunctions_MP3; +#endif + #if (defined SOUND_SUPPORTS_VOC) extern const Sound_DecoderFunctions __Sound_DecoderFunctions_VOC; #endif @@ -54,6 +58,10 @@ static const Sound_DecoderFunctions *decoderFuncs[] = { +#if (defined SOUND_SUPPORTS_MP3) + &__Sound_DecoderFunctions_MP3, +#endif + #if (defined SOUND_SUPPORTS_VOC) &__Sound_DecoderFunctions_VOC, #endif @@ -152,7 +160,10 @@ void Sound_SetError(const char *err) { if (err != NULL) + { + _D(("Sound_SetError(\"%s\");\n", err)); SDL_SetError(err); + } /* if */ } /* Sound_SetError */ @@ -228,6 +239,30 @@ } /* alloc_sample */ +#if (defined DEBUG_CHATTER) +static __inline__ const char *fmt_to_str(Uint16 fmt) +{ + switch(fmt) + { + case AUDIO_U8: + return("U8"); + case AUDIO_S8: + return("S8"); + case AUDIO_U16LSB: + return("U16LSB"); + case AUDIO_S16LSB: + return("S16LSB"); + case AUDIO_U16MSB: + return("U16MSB"); + case AUDIO_S16MSB: + return("S16MSB"); + } /* switch */ + + return("Unknown"); +} /* fmt_to_str */ +#endif + + /* * The bulk of the Sound_NewSample() work is done here... * Ask the specified decoder to handle the data in (rw), and if @@ -303,6 +338,19 @@ } /* if */ samplesList = sample; + _D(("New sample DESIRED format: %s format, %d rate, %d channels.\n", + fmt_to_str(sample->desired.format), + sample->desired.rate, + sample->desired.channels)); + + _D(("New sample ACTUAL format: %s format, %d rate, %d channels.\n", + fmt_to_str(sample->actual.format), + sample->actual.rate, + sample->actual.channels)); + + _D(("On-the-fly conversion: %s.\n", + internal->sdlcvt.needed ? "ENABLED" : "DISABLED")); + return(1); } /* init_sample */