# HG changeset patch # User Ryan C. Gordon # Date 1000972584 0 # Node ID f27bcbcaeab196fde85fef53dd11ac30c6f07526 # Parent b2313d8c27cfea34b2eb46be9cf276ca476e6953 Added AIFF entry, and (for now) some multiple-streams-in-one-rwops support. diff -r b2313d8c27cf -r f27bcbcaeab1 SDL_sound.c --- a/SDL_sound.c Thu Sep 20 07:54:47 2001 +0000 +++ b/SDL_sound.c Thu Sep 20 07:56:24 2001 +0000 @@ -52,6 +52,10 @@ extern const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV; #endif +#if (defined SOUND_SUPPORTS_AIFF) +extern const Sound_DecoderFunctions __Sound_DecoderFunctions_AIFF; +#endif + #if (defined SOUND_SUPPORTS_OGG) extern const Sound_DecoderFunctions __Sound_DecoderFunctions_OGG; #endif @@ -74,6 +78,10 @@ &__Sound_DecoderFunctions_WAV, #endif +#if (defined SOUND_SUPPORTS_AIFF) + &__Sound_DecoderFunctions_AIFF, +#endif + #if (defined SOUND_SUPPORTS_OGG) &__Sound_DecoderFunctions_OGG, #endif @@ -293,8 +301,8 @@ Sound_AudioInfo *_desired) { Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; + Sound_AudioInfo desired; int pos = SDL_RWtell(internal->rw); /* !!! FIXME: Int? Really? */ - Sound_AudioInfo desired; /* fill in the funcs for this decoder... */ sample->decoder = &funcs->info; @@ -355,6 +363,10 @@ } /* if */ samplesList = sample; +#if (defined MULTIPLE_STREAMS_PER_RWOPS) + internal->pos = SDL_RWtell(internal->rw); +#endif + _D(("New sample DESIRED format: %s format, %d rate, %d channels.\n", fmt_to_str(sample->desired.format), sample->desired.rate, @@ -532,7 +544,20 @@ /* reset EAGAIN. Decoder can flip it back on if it needs to. */ sample->flags &= !SOUND_SAMPLEFLAG_EAGAIN; +#if (defined MULTIPLE_STREAMS_PER_RWOPS) + if (SDL_RWseek(internal->rw, internal->pos, SEEK_SET) == -1) + { + sample->flags |= SOUND_SAMPLEFLAG_ERROR; + return(0); + } /* if */ +#endif + retval = internal->funcs->read(sample); + +#if (defined MULTIPLE_STREAMS_PER_RWOPS) + internal->pos = SDL_RWtell(internal->rw); +#endif + if (internal->sdlcvt.needed) { internal->sdlcvt.len = retval;