[SDL_sound] AIFF decoder (fwd)

Ryan C. Gordon icculus at clutteredmind.org
Thu Sep 20 08:05:44 EDT 2001

(I really need to set the mailing lists up with a Reply-To: field...)

---------- Forwarded message ----------
Date: Thu, 20 Sep 2001 11:12:38 +0200
From: "[iso-8859-1] Torbjörn Andersson"
To: Ryan C. Gordon <icculus at clutteredmind.org>
Subject: Re: [SDL_sound] AIFF decoder

> Not to mention that, sooner or
> later, a HTTP or whatnot RWops will show up that can't perform seeking,
> and then we're in trouble.

True, I didn't think of that.

> 1) It's safe to get more than one FILE * to a file that is opened read
> only. You can then seek and read in each FILE * independent of the others.
> If the source of your FILE * can be changed to fopen() the same physical
> file again for each sound source

Another good point that I didn't think of. I can't really test it until
SDL_mixer is rewritten to use SDL_sound (at the moment I just dump the audio
data into a temporary file which is removed once the sound has finished
playing, which is a bit crude), but I'll keep it in mind.

At the rate you're going (don't you ever sleep? :-) it shouldn't be that far
away, right?

> 2) If we use the patch to SDL_sound, if nothing else, you'll have to make
> sure that you wrap each of these "files" in a reference counting RWops,
> since SDL_sound closes the RWops when done with it,

I don't think I would have to in this particular case. Closing a FILE RWops
only closes the actual file if the 'autoclose' argument to SDL_RWFromFP() was
non-zero, right?

But in the light of everything else you say - phrases like "thread unsafe"
scare me - I'll most likely go with #1. Thanks for the tip!

Torbjörn Andersson

More information about the sdlsound mailing list