Andre Noll [Sun, 30 Nov 2008 14:13:35 +0000 (15:13 +0100)]
wav: Only create wav header if there is output available.
Due to recent changes to filter_chain.c, the convert functions of all
activated filters are called even if there is no output availabe since
the ogg vorbis decoder needs this.
However, this change broke the wav filter: wav_convert() is now called
even if the previous filter (e.g. oggdec) has not yet determined the
format of the input stream.
This caused the wav filter to write out an invalid wav header with 0
channels. Fix it by not doing anything unless wav_convert() gets called
with non-empty input.
Andre Noll [Fri, 28 Nov 2008 12:07:08 +0000 (13:07 +0100)]
Get rid of a gcc warning on recent Ubuntu systems.
fchdir() is marked with warn_unused_result which produces a
warning in the error path of para_opendir(). However, we really
want to ignore the return value in this particular case, so introduce
a rather ugly fix to avoid the warning.
Andre Noll [Sat, 22 Nov 2008 16:49:39 +0000 (17:49 +0100)]
http_recv: Fix reading of the HTTP OK message pattern.
This bug leads to sound artefacts at the beginning of the
stream caused by calling recv_pattern() with a buffer size
larger than the HTTP OK message.
It may thus happen that the buffer used by recv_pattern() contains
not only the HTTP OK message but also the beginning of the stream.
Since that buffer is discarded by recv_pattern(), the first few
bytes of the stream are lost if this happens.
Fix it by passing the exact length of the HTTP OK message to
recv_pattern().
Andre Noll [Sat, 22 Nov 2008 16:38:16 +0000 (17:38 +0100)]
Fix an off-by-one bug in recv_pattern().
The current code in recv_pattern() allocates a buffer of size
bufsize + 1 and calls recv_buffer() with bufsize as the size
parameter. However, recv_buffer() reserves the last byte of the
buffer for storing the terminating NULL byte, so that at most
bufsize - 1 characters are read.
Fix it by passing bufsize + 1 (the real size of the buffer)
to recv_buffer().
Andre Noll [Thu, 13 Nov 2008 19:55:51 +0000 (20:55 +0100)]
call_callback(): Fix a shm leak in afs.c.
We forgot to detach the shm area passed from the child which results in
"no space left" messages if many audio files are added and the number
of shared memory areas exceeds 4096.
Andre Noll [Sun, 12 Oct 2008 22:02:35 +0000 (00:02 +0200)]
stdin: Abort if the consumer terminates.
The bug in the wav filter which was fixed in the previous patch
could cause para_filter to hang because the stdin task would not
care whether the filter task has terminated.
Andre Noll [Tue, 30 Sep 2008 20:23:18 +0000 (22:23 +0200)]
Implement better error diagnostics for para_client.
In case the config file contains errors, the old code caused
para_client to exit without printing an error message.
We need print_errors == 0 in client_open() because this function
is also used by para_audiod which might not have a controlling
terminal. So use gengetopt's --no-handle-error option that instructs
the command line parser not to exit on errors. This wy we can use
PARA_ERROR_LOG() to log an appropriate error message.
Andre Noll [Sat, 12 Jul 2008 10:40:36 +0000 (12:40 +0200)]
Fix a bug in para_write.
With the old code, the command "para_write < /dev/null" would
segfault because the wng_close() is called although the writer
node group was never opened. Fix this bug by introducing a new
field in struct writer_node_group that tracks whether wng_open()
was called.
Andre Noll [Sun, 6 Jul 2008 22:23:36 +0000 (00:23 +0200)]
score_update(): Don't return an error if file is not admissible.
This function is called whenever the afs_info struct changed,
for example if the user executed a touch command. Simply
ignore the request to update the score in case the file is not
contained in the score table.
Andre Noll [Sun, 6 Jul 2008 17:34:08 +0000 (19:34 +0200)]
audiod: Make stat_task static.
The only reason it wasn't static was that audiod_command.c
could use it. However, audiod_command.c only needs
stat_item_values[] and several other fields that were only
used in get_time_string().
So move stat_item_values[] out of struct status task so that
audiod_command.c can use it, and move get_time_string() from
audio_command.c to audiod.c.