Andre Noll [Mon, 21 May 2007 20:53:23 +0000 (22:53 +0200)]
error.h: move E_BAD_USER from audiod_command to command error list
Dooh. This caused a segfault in the server's child if an unkown user
connected. Fortunately, this happened right before the process exited
anyway, so it's not a security issue.
Andre Noll [Fri, 30 Mar 2007 15:14:04 +0000 (17:14 +0200)]
fix compress filter for big endian machines
This was broken since day one as it depended on little-endianness. Fix
it by checking the byte sex in configure and let the decoders
produce host endian 16 bit audio output by using the new
write_int16_host_endian() inline function in filter.h
This allows to omit the ugly byte-swapping in osx_write we've had
before.
Andre Noll [Sat, 24 Mar 2007 21:20:29 +0000 (22:20 +0100)]
ogg_afh.c: store bitrate, frequency and channels in struct audio_file info
This patch also contains some other improvements:
- make sure that we never write beyond the end of the chunk table
- get rid of some unneeded includes
- kill pointless raw_total variable
- get rid of time_total, vi_sampling_rate and vi_bitrate and use
the corresponding members of struct audio_file_info directly
Andre Noll [Sat, 24 Mar 2007 17:14:57 +0000 (18:14 +0100)]
afh: add additional fields channels, frequency, and bitrate to struct audio_format
The idea is that these quantieties are computed by each audio format handler
anyway. So create a common place for them to store that info. This way it
may be used by vss and by afs.
Andre Noll [Thu, 22 Mar 2007 15:15:42 +0000 (16:15 +0100)]
vss.c: Don't try to mmap empty files
as this causes mmap() to return MAP_FAILED, i.e. para_mmap() calls
exit() so para_server dies, which clearly is inapproriate. Instead,
skip the audio file and try the next one if size == 0.
Andre Noll [Mon, 12 Mar 2007 19:38:43 +0000 (20:38 +0100)]
first draft of the mmap patch series
The purpose of these changes to para_server is to not call
read()/fseek() in the audio format handlers and in vss.c but to use
mmap() instead which should result in less code and should also be
faster and less error-prone.
This first patch implements the basic infrastructure for mmap but
keeps the file pointer so that changes may be merged step by step and
changes the ogg vorbis audio format handler to use the new mapping
of the audio file.
Subsequent patches will change the other audio format handlers and
the virtual streaming system to also use mmap instead of read()/fseek().
Andre Noll [Sun, 11 Mar 2007 17:40:08 +0000 (18:40 +0100)]
kill close_audio_file handler from struct audio format.
All audio format handlers just did fclose(), so do this from vss.c
and kill the handler. This also allows to get rid of the global
infile variable in all audio format handlers.
Andre Noll [Sun, 11 Mar 2007 17:11:37 +0000 (18:11 +0100)]
aac_afh.c: free the inbuffer already in aac_get_file_info()
No need to wait for this until the audio file gets closed. This
patch also fixes two occurences of a bug where the length of the
input buffer was not set correctly.
Andre Noll [Sun, 11 Mar 2007 16:34:00 +0000 (17:34 +0100)]
introduce struct audio_format_info
This further simplifies the audio format handlers. The chunk_table
and the header info is now contained in that struct which allows
to move the cleanup on eof from the audio format handlers to the
virtual streaming system.
Andre Noll [Sat, 10 Mar 2007 19:31:00 +0000 (20:31 +0100)]
ogg_afh.c: Switch to ogg vorbis callbacks
This allows to call ov_clear() already during ogg_get_file_info() which
in turn simplifies ogg_close_audio_file().
This is a preparation for moving the close function of the audio
format handlers to the virtual streaming system as they all do
essentially the same now.
Andre Noll [Sun, 4 Mar 2007 22:54:17 +0000 (23:54 +0100)]
simplify ogg_compute_chunk_table()
it rewinds the input file on entry and on exit. Do this in the caller instead
which allows to get rid of the file parameter in ogg_compute_chunk_table().
Andre Noll [Sun, 4 Mar 2007 22:22:43 +0000 (23:22 +0100)]
simplify vss_read_chunk()
All its parameters are known globally within vss.c, so omit them.
Also, return an int instead of the pointer to the inbuffer which is
also known to the caller.
This patch also introduces para_fseek() in fd.c which is used by
mp3.c and vss.c and changes the mp3 audio format handler so that it
uses the new function and always check the return value.
Andre Noll [Sun, 4 Mar 2007 20:07:33 +0000 (21:07 +0100)]
unify all audio format handlers
This changes the ogg vorbis audio format handler such that its read_chunk and
reposition_stream functions coincide with those of the other audio format
handlers.
Andre Noll [Sun, 4 Mar 2007 19:18:34 +0000 (20:18 +0100)]
unify aac and mp3 audio format handlers
This makes the mp3 audio format handler use a chunk table just like
m4a and ogg vorbis already do. Moreover, the aac and mp3 audio format
handlers now have identical read_chunk and reposition_stream handlers.
Next step is to tweak the ogg vorbis audio format handler so that
it also fits into this scheme. In the end, this allows to move
read_chunk() and reposition_stream() from the audio format handlers
one layer up to the virtual streaming system and to kill the function
pointers in struct audio_format.
The advantage of this change that it avoids duplicated/similar code, and
that new audio format handlers can added easier.