[freespace2] Patches for music and movies

Pierre Willenbrock pierre at linux-net.dnsalias.org
Sun Mar 27 11:13:58 EST 2005


Taylor Richards wrote:
> The movie
> audio stuff doesn't help me out much in fs2_open since I'm going right
> through audiostream there.  Saved me a bit of work though!
Most code in these patches is 2 years old. I was relatively new to c++ 
and back then audiostream didn't work, so i built on openAL. I actually 
implemented audiostreaming after movie audio, so there is some code 
duplication. I never changed that.
> 
> Bugs found (just FYI, Pierre):
> - bad memset call in audiostr.cpp
Do you know pascals fillchar(data,size,value)? I always mess them up 
after switching programming language...
> - SDL_InitSubSystem() needs to just be in audiostream_init()
> - can't use CFILE (like I mentioned already) it's just too slow
After looking at cfread() i don't see why it is slow. It does no costly 
data copying or the like. The only problem that i see is it is using 
fread(), which buffers unnecessaryly.
> - missing pause/unpause stuff, that's used quite a bit (I filled this
> in)
I had this, but it was lost when merging with current CVS. I better had 
searched the file for STUB_FUNCTION.
> - didn't close out the SDL_RWops handles in the acm code (memory leaks)
I splitted ACM_convert_ADPCM_to_PCM() which doesn't close them either. I 
should have looked at fs2_open earlier. In my old codebase i had my own 
adpcm decoder.

Anyway, nice to see this getting into cvs. I may have some more (minor) 
things in my old sources, and a hack for cdrom detection on linux(i even 
recoded the copy protection. Although i switched it off). But those 
areas have changed since, so it is a bit harder to get it working.

Pierre



More information about the freespace2 mailing list