[SDL] Appending resources to .exe
Steaphan Greene
stea at cs.binghamton.edu
Thu Apr 5 00:59:05 PDT 2007
On Thu, Apr 05, 2007 at 10:27:05AM +0300, Martin Storsjö wrote:
> > You're right. I do essentially the same thing, but with on-the-fly
> > decompression using bzip2. But one thing that really bothers me is
> > having to extract MP3 files to the file system with the .mp3
> > extension to be able to have SDL_Mixer read it.
>
> Ah, but if you do decompression you probably get the file start/end
> correctly in your SDL_RWops, so that seeking works as it should. In
> that case it's probably only a problem with the MP3 file loading in
> SDL_Mixer, as you suspected.
If I remember correctly, this is because the MP3 loading code, and many
others, do a SEEK_SET or SEEK_END style seek, meaning relative to the
overall beginning or end of your stream, not relative to where you tell
it to start. This is due to the headers and organization of these
filetypes. It is totally possible to fix this with a custom replacement
for the SDL_RWOps structure created by the RWOps open function with
custom functions which artificially restrict this seeking and even
reading/writing manually based on the ranges you give it. I believe
I've even done this, but can't seem to locate my code for it at the
moment.
--
Steaphan Greene <sgreene at cs.binghamton.edu>
Lecturer, Computer Science, Binghamton University
GPG public key: http://www.cs.binghamton.edu/~sgreene/gpg.key.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070405/b9a047da/attachment.pgp
More information about the SDL
mailing list