paraslash.git
13 years agoMake autoconf-2.66 happy. v0.3
Andre Noll [Mon, 5 Jul 2010 21:42:31 +0000 (23:42 +0200)]
Make autoconf-2.66 happy.

This removes more lines than it adds and avoids the following warning;

configure.ac:689: warning: AC_DEFINE_UNQUOTED: `
configure.ac:689:       result=
configure.ac:689:       for i in $status_items; do
configure.ac:689:               result="$result SI_$(echo $i | tr 'a-z' 'A-Z')' is not a valid preprocessor define value
(cherry picked from commit 5842e3e7f2aa17fe16cb806b4ba955ce1f25ce53)

13 years agoserver: Avoid invalid free() in com_help().
Andre Noll [Thu, 3 Feb 2011 08:12:39 +0000 (09:12 +0100)]
server: Avoid invalid free() in com_help().

If the argument to com_help is not a valid command, we try to free
uninitialized memory which may lead to a segfault.

This bug existed at least since day 1 of the git repo.

13 years agogui: Avoid busy loop if audiod is down.
Andre Noll [Sun, 6 Jun 2010 16:32:11 +0000 (18:32 +0200)]
gui: Avoid busy loop if audiod is down.

The old approach to sleep one second is not sufficient and might still lead
to a busy loop as the call to sleep() might be interrupted by SIGCHILD.

So check the return value of sleep() and sleep again if it is not zero.

13 years agostring: constant value
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
string: constant value

This replaces the LLONG_MAX constant with the value stolen
from limits.h (that value is only accessible when using
-std=c99). The value of 2^63-1 assumes 64-bit and can also
be computed as (1ULL << (sizeof(long long) * 8 - 1)) - 1).

13 years agooss: Fix double free bug on open failure.
Andre Noll [Wed, 12 May 2010 21:22:37 +0000 (23:22 +0200)]
oss: Fix double free bug on open failure.

If setting the oss parameters (sample format, sample rate, channel
count) fails, we end up freeing the private_oss_data struct twice.

14 years agochunk queue: Fix chunk dequeuing.
Andre Noll [Mon, 12 Apr 2010 16:04:31 +0000 (18:04 +0200)]
chunk queue: Fix chunk dequeuing.

We missed to update the number of pending bytes when removing
a chunk from the queue.

This patch also clarifies the description of the cq parameter of
cq_dequeue().

Thanks to Gerrit Renker who pointed out this bug.

14 years agoudp_send: Fix com_off.
Andre Noll [Thu, 8 Apr 2010 18:23:15 +0000 (20:23 +0200)]
udp_send: Fix com_off.

When the off command is executed, the udp sender sends an eof packet
to all configured targets. However, it then continues to send data.

Fix this by returning early in udp_send_fec() if the sender has been
switched off.

14 years agosetup_next_fec_group(): Return early on eof.
Andre Noll [Sun, 7 Mar 2010 15:34:25 +0000 (16:34 +0100)]
setup_next_fec_group(): Return early on eof.

The old code updated the group start via set_group_timing() even if the
end of the file was reached. This could confuse the logic in vss_send()
as it uses the goup start timestamp to find out whether all FEC clients
have sent all remaining slices.

Fix this by moving the check for the eof condition before the call to
set_group_timing() that updates the group start.

14 years agorecv: Don't set argv to NULL when parsing receiver args.
Andre Noll [Sun, 31 Jan 2010 22:16:15 +0000 (23:16 +0100)]
recv: Don't set argv to NULL when parsing receiver args.

This leads to error messages like

(null): unrecognized option '--foo'

in case an invalid option was given. Fix it by setting argv[0] to
the receiver name instead.

Thanks to Gerrit Renker for pointing out this bug.

14 years agoMerge remote branch 'athcx/maint' into maint
Andre Noll [Sun, 17 Jan 2010 20:32:11 +0000 (21:32 +0100)]
Merge remote branch 'athcx/maint' into maint

14 years agostdin: Fix a signed bug.
Andre Noll [Tue, 29 Dec 2009 00:14:50 +0000 (01:14 +0100)]
stdin: Fix a signed bug.

We have to return a negative error code.

14 years agoaudiod: Invalidate the current audio format when closing the receiver.
Andre Noll [Sun, 20 Dec 2009 18:49:46 +0000 (19:49 +0100)]
audiod: Invalidate the current audio format when closing the receiver.

This avoids restarting the same receiver immediately as it causes audiod to
wait until the audio format status item is received again.

14 years agoaudiod: Avoid starting the wrong decoder on server restarts.
Andre Noll [Sat, 19 Dec 2009 15:50:28 +0000 (16:50 +0100)]
audiod: Avoid starting the wrong decoder on server restarts.

If para_server is restarted and starts streaming using another audio format than
the one used before the restart, para_audiod might end up starting the decoder
associated with the old audio format.

Fix this by invalidating current_audio_format_num in close_stat_pipe() which is
called when the server goes away.

14 years agofecdec: Fix a double-free bug in clear_group().
Andre Noll [Sat, 19 Dec 2009 15:47:20 +0000 (16:47 +0100)]
fecdec: Fix a double-free bug in clear_group().

We must make sure fg->data isn't freed twice.

14 years agohttp_send: Send http OK message earlier.
Andre Noll [Sat, 19 Dec 2009 12:13:53 +0000 (13:13 +0100)]
http_send: Send http OK message earlier.

Without this change, the http OK message is sent just when the vss is about to start
streaming, i.e. at the end of the announce interval. This might be too late and sometimes
causes the client to not receive the first chunk(s).

Fix this bug by adding the client file descriptor to the write fd set in http_preselect()
in case we received the get request (or something else) so that the following call
to select() will return immediately. The http OK message (or an error message) will
then be sent much earlier.

14 years agoosx_write: Make it compile on Snow Leopard.
Andre Noll [Wed, 9 Dec 2009 17:00:56 +0000 (18:00 +0100)]
osx_write: Make it compile on Snow Leopard.

14 years agonew codename, reset version to git
Andre Noll [Mon, 7 Dec 2009 17:01:07 +0000 (18:01 +0100)]
new codename, reset version to git

14 years agothe paraslash-0.3.6 release tarball
Andre Noll [Mon, 7 Dec 2009 16:56:41 +0000 (17:56 +0100)]
the paraslash-0.3.6 release tarball

14 years agoparaslash 0.3.6 v0.3.6
Andre Noll [Mon, 7 Dec 2009 16:54:46 +0000 (17:54 +0100)]
paraslash 0.3.6

14 years agoNEWS update.
Andre Noll [Wed, 2 Dec 2009 06:41:27 +0000 (07:41 +0100)]
NEWS update.

Add release notes for the upcoming 0.3.6 release.

14 years agoChange codename.
Andre Noll [Wed, 2 Dec 2009 06:40:37 +0000 (07:40 +0100)]
Change codename.

As there will be another 0.3.x release, we need a new codename.

14 years agofecdec: Wait until the second FEC group is complete.
Andre Noll [Mon, 30 Nov 2009 22:50:48 +0000 (23:50 +0100)]
fecdec: Wait until the second FEC group is complete.

Currently the fecdec filter starts writing output as soon as the first slice of the
second group arrives. This makes the logic in fecdec_filter.c quite convoluted
and does not help much to avoid buffer underruns.

Waiting for completion of the second group simplifies the code quite a bit and
adds more more buffering to the fecdec filter which should make buffer underruns
less likely.

14 years agoFEC: Improve and simplify group timing.
Andre Noll [Fri, 27 Nov 2009 19:36:23 +0000 (20:36 +0100)]
FEC: Improve and simplify group timing.

The computation of the group start time was not as accurate as it
could be because it did not take into account that the first FEC
group has to be taken into account twice. This could lead to buffer
underruns between the first and the second group.

This patch fixes this flaw by computing the group start start(n)
of the nth FEC group as

start(n) = start(n - 1) + duration(n - 1),

which is not only more accurate but also a bit simpler than what we
had before. In order to do so, we have to remember the duration of
the previous group. The new ->duration member of struct fec_group is
used for this purpose.

The patch also renames set_slice_duration() to set_group_timing() as
this function now computes and stores both the slice duration and the
group duration.

14 years agofecdec: Defer decoding until the next group after the first _usable_ fec group starts.
Andre Noll [Wed, 18 Nov 2009 18:23:45 +0000 (19:23 +0100)]
fecdec: Defer decoding until the next group after the first _usable_ fec group starts.

Commit faeabd31b4bea5c097acff4738a0626e3c84f1d9 (fecdec: Defer decoding until
the first slice of the second group arrives.) changed the fec decoder such that it does
not start to write the decoded output ASAP but waits until the next group starts.

This is generally a good idea, but the patch missed the fact that the first complete group
might be unusable in case of streams that carry an audio file header (currently only ogg
vorbis).

Fix this flaw by setting the completion status to GCS_FIRST_GROUP_COMPLETE only
if we received a complete group that is also usable.

14 years agohttp/dccp: Do not send the audio file header twice.
Andre Noll [Thu, 12 Nov 2009 23:39:22 +0000 (00:39 +0100)]
http/dccp: Do not send the audio file header twice.

If the http/dccp client connects before stream start and the stream
starts at the beginning of the audio file (the common case), we do not
need to send the audio file header as it is contained in chunk zero.

However, the current code fails to set sender_client->sent_header to
a non-zero value in this case. This causes the header to be sent twice.

The ogg vorbis decoder is quite forgiving in that respect, which is
probably why this bug went unnoticed for so long. This patch gets
it right.

14 years agoMerge commit 'meins/maint' into maint
Andre Noll [Mon, 9 Nov 2009 17:30:26 +0000 (18:30 +0100)]
Merge commit 'meins/maint' into maint

14 years agoalsa: Avoid using 0 as a NULL pointer.
Andre Noll [Sat, 7 Nov 2009 13:06:55 +0000 (14:06 +0100)]
alsa: Avoid using 0 as a NULL pointer.

Found by sparse.

14 years agofecdec_filter: Avoid potentially expensive pointer subtraction.
Andre Noll [Sat, 7 Nov 2009 13:05:18 +0000 (14:05 +0100)]
fecdec_filter: Avoid potentially expensive pointer subtraction.

Found by sparse.

14 years agoMake some blob functions static.
Andre Noll [Sat, 7 Nov 2009 13:03:36 +0000 (14:03 +0100)]
Make some blob functions static.

14 years agoMerge commit 'meins/maint' into maint
Andre Noll [Fri, 6 Nov 2009 14:19:32 +0000 (15:19 +0100)]
Merge commit 'meins/maint' into maint

14 years agoReplace assertion for invalid audio formats by a runtime check.
Andre Noll [Fri, 6 Nov 2009 14:07:18 +0000 (15:07 +0100)]
Replace assertion for invalid audio formats by a runtime check.

In case one switches back and forth between different versions of
para_server that support different audio formats, it may happen
that the aft table contains entries for audio formats that are not
supported by the version currently running.

ATM, this causes para_server to die immediately because of the
assertion in audio_format_name. Replace the assertion by a less
draconian run time check that returns the string "???" if the number
for an unknown audio file format is being looked up.

14 years agoserver: Fix assignment of afs_pid.
Andre Noll [Thu, 5 Nov 2009 23:21:16 +0000 (00:21 +0100)]
server: Fix assignment of afs_pid.

glibc-2.11 revealed the following bug in init_afs(): The assignment

mmd->afs_pid = fork();

results in undefined behaviour because fork() returns twice and mmd->afs_pid lives
in a shared memory area. Depending on whether the child runs first, this results in
mmd->afs_pid being either zero or the pid of the afs child process.

mmd->afs_pid being zero seems to happen always with glibc-2.11 and has rather
strange consequences:

First,  it causes para_server attempt to kill process 0 instead of the afs process on
exit. This fails because para_server never runs as root.  However, it may result in dirty
osl tables as the afs process might access mmd after the shared memory area containing
mmd has already been destroyed.

Second,  para_server fails to notice the death of the afs process, which is really bad and
may cause tons of error messages being written to the log.

Fix this bug by temporarily storing the afs pid in a local variable and setting mmd->afs_pid
only in the server (parent) process.

14 years agowng: Avoid buffer underruns due to filter chain output buffer constraints.
Andre Noll [Thu, 5 Nov 2009 21:42:52 +0000 (22:42 +0100)]
wng: Avoid buffer underruns due to filter chain output buffer constraints.

Using ogg vorbis streams together with the oss writer hits the following nasty bug:
In case the filter chain can provide more data than what fits into its output buffer,
it converts the maximal amount possible to completely fill its output buffer. However, the
time to play this data might be less than than the time until the next data packet arrives
from the upper layers, especially when using ogg vorbis streams and FEC.

Since the filter chain task has no pre_select function,  the convert function(s) of its filter
nodes only get the chance to convert more data until the next select call returns, which
might already be too late.

This patch fixes the bug by teaching the pre_select function of the writer node group
to  remember whether something was written during the previous call  to wng_post_select().
In this case we force a minimal timeout for select, i.e. the next call to select() will return
immediately and the convert functions of the filter node are called again, hopefully converting
more data for the writer node group.

14 years agooss_post_select(): Kill unused attribute for the struct sched parameter.
Andre Noll [Thu, 5 Nov 2009 21:23:13 +0000 (22:23 +0100)]
oss_post_select(): Kill unused attribute for the struct sched parameter.

This parameter _is_ used.

14 years agooss_pre_select(): Fix check for empty infput buffer.
Andre Noll [Thu, 5 Nov 2009 21:21:38 +0000 (22:21 +0100)]
oss_pre_select(): Fix check for empty infput buffer.

We must take into account the number of bytes already written, and we can not write less
than a single frame.

14 years agoMerge commit 'meins/maint' into maint
Andre Noll [Sun, 25 Oct 2009 16:47:50 +0000 (17:47 +0100)]
Merge commit 'meins/maint' into maint

14 years agovss: Fix computation of extra slices.
Andre Noll [Sat, 24 Oct 2009 19:03:06 +0000 (21:03 +0200)]
vss: Fix computation of extra slices.

On stream start we check in setup_next_fec_group() whether the FEC
parameters requested by the client are sufficient for the current audio
file. We want each FEC group contain at least one non-header slice.

Since header slices can not contain any non-header data, the number
of required slices is given by the number of slices needed for the
header plus the number of slices needed for the largest chunk of the
audio file.

The current code gets this wrong because it computes the number of
slices needed for the header plus the largest chunk, which may be
strictly less than what is actually needed. IOW, the inequality

  num_slices(header + chunk) <= num_slices(header) + num_slices(chunk)

may be strict.

This bug could trigger the assertion assert(g->num_chunks) further
down in setup_next_fec_group().

This patch fixes this bug and also changes a log message in
udp_init_session() which always printed the requested FEC parameters,
not considering extra slices.

14 years agoMerge commit 'meins/maint' into maint
Andre Noll [Fri, 23 Oct 2009 08:38:17 +0000 (10:38 +0200)]
Merge commit 'meins/maint' into maint

14 years agopopulate_user_list(): Use correct buffer size.
Andre Noll [Thu, 22 Oct 2009 20:50:58 +0000 (22:50 +0200)]
populate_user_list(): Use correct buffer size.

"line" is defined as a 255 byte buffer. Use sizeof(line) rather than MAXLINE in the call
to para_fgets().

This is not a real bug though as MAXLINE happens to be 255 as well.

14 years agodaemon: Avoid using MAXLINE.
Andre Noll [Thu, 22 Oct 2009 20:47:19 +0000 (22:47 +0200)]
daemon: Avoid using MAXLINE.

MAXLINE is kind of depricated. Just use a 100 byte buffer and make the scope of the
buffer more local. Also, kill the pointless initialization to an empty string.

14 years agodrop_privileges_or_die(): Check return value of setuid().
Andre Noll [Thu, 22 Oct 2009 20:42:36 +0000 (22:42 +0200)]
drop_privileges_or_die(): Check return value of setuid().

The call to setuid() may fail, e.g. because it brings the process over its RLIMIT_NPROC
resource limit. So print an error message and exit in this case.

14 years agofecdec: Fix decoding of the audio file header.
Andre Noll [Thu, 22 Oct 2009 17:21:10 +0000 (19:21 +0200)]
fecdec: Fix decoding of the audio file header.

The handling of the audio file header in the fecdec code is currently
broken: We output all decoded header slices although the last slice
might only be partially used.

This patch introduces the new fec_group_usability value
"FEC_GROUP_USABLE_WITH_HEADER" which gets used when streaming starts in
the middle of the file. In this case, after the group has been decoded,
we make sure that only h.audio_header_size many bytes are being written
to the output buffer. We then proceed to write the output corresponding
to the data slices as in the FEC_GROUP_USABLE_SKIP_HEADER case.

In paraslash-0.3. only ogg vorbis uses audio file headers, and the
ogg code is quite forgiving and successfully resyncs the stream,
which is why this bug was never noticed. However, the wma decoder of
paraslash-0.4 fails badly due to the garbage that is written after
the header.

14 years agoFix error message in case of missing sys/soundcard.h.
Andre Noll [Fri, 16 Oct 2009 13:35:00 +0000 (15:35 +0200)]
Fix error message in case of missing sys/soundcard.h.

The error message still printed linux/soundcard.h which might
confuse non-linux users.

14 years agoAdd *_command_list.c to .gitignore.
Andre Noll [Tue, 6 Oct 2009 21:16:11 +0000 (23:16 +0200)]
Add *_command_list.c to .gitignore.

14 years agoUse para_malloc() instead of malloc() everywhere.
Andre Noll [Tue, 6 Oct 2009 20:00:55 +0000 (22:00 +0200)]
Use para_malloc() instead of malloc() everywhere.

14 years agoogg: retry ov_open_callbacks() also on OV_EBADHEADER errors.
Andre Noll [Tue, 6 Oct 2009 17:31:17 +0000 (19:31 +0200)]
ogg: retry ov_open_callbacks() also on OV_EBADHEADER errors.

14 years agoreset version to git
Andre Noll [Thu, 24 Sep 2009 12:25:58 +0000 (14:25 +0200)]
reset version to git

14 years agothe paraslash-0.3.5 release tarball
Andre Noll [Mon, 21 Sep 2009 10:52:54 +0000 (12:52 +0200)]
the paraslash-0.3.5 release tarball

14 years agoparaslash 0.3.5 v0.3.5
Andre Noll [Mon, 21 Sep 2009 10:48:04 +0000 (12:48 +0200)]
paraslash 0.3.5

14 years agoMerge commit 'meins/master'
Andre Noll [Mon, 21 Sep 2009 07:37:06 +0000 (09:37 +0200)]
Merge commit 'meins/master'

14 years agoNEWS update.
Andre Noll [Sat, 19 Sep 2009 08:47:08 +0000 (10:47 +0200)]
NEWS update.

14 years agooggdec filter improvements.
Andre Noll [Sat, 19 Sep 2009 08:38:25 +0000 (10:38 +0200)]
oggdec filter improvements.

Try to open the ogg vorbis callbacks as soon as possible rather
than waiting until the input buffer reaches the given initial buffer
size. If that fails, try again later when more data is available but
fail if the input buffer size is larger than the initial buffer size
and we can still not open the ov callbacks.

Also, if a hole was detected, likely because we started streaming
in the middle of the file, add an additional delay to avoid buffer
underruns.

14 years agoComplete re-write of the ogg vorbis audio format handler.
Andre Noll [Sat, 19 Sep 2009 08:26:04 +0000 (10:26 +0200)]
Complete re-write of the ogg vorbis audio format handler.

The new code is quite a bit smaller, performes much better and chooses
a chunk time dependent on the average ogg page size rather than using
a hardcoded chunk time of 250ms.

14 years agofecdec: Defer decoding until the first slice of the second group arrives.
Andre Noll [Sat, 19 Sep 2009 08:21:48 +0000 (10:21 +0200)]
fecdec: Defer decoding until the first slice of the second group arrives.

Otherwise, this could lead to buffer underruns in the decoding application
in case slices are missed. So introdce group_completion_status which tracks
whether we already have received the first group sucessfully and are waiting
for the first slice of the next group.

14 years agoafh: Fix memory leak.
Andre Noll [Sat, 19 Sep 2009 08:18:14 +0000 (10:18 +0200)]
afh: Fix memory leak.

14 years agostdin: Increase input buffer size.
Andre Noll [Sat, 19 Sep 2009 08:16:23 +0000 (10:16 +0200)]
stdin: Increase input buffer size.

16K was a bit small for the ogg_decode filter.

14 years agotv_scale(): Avoid integer overflow.
Andre Noll [Sat, 19 Sep 2009 08:11:19 +0000 (10:11 +0200)]
tv_scale(): Avoid integer overflow.

Just use an uint64_t and compute everything in microseconds which even
simplifies the code a bit.

14 years agovss: Honor header chunk when computing FEC group start.
Andre Noll [Sat, 19 Sep 2009 08:08:59 +0000 (10:08 +0200)]
vss: Honor header chunk when computing FEC group start.

The first chunk of an ogg vorbis file is the audio file header
which should not be included in the calculation of the FEC
group timing.

14 years agoMerge commit 'meins/master'
Andre Noll [Mon, 14 Sep 2009 08:08:57 +0000 (10:08 +0200)]
Merge commit 'meins/master'

14 years agoMinor documentation fixes.
Andre Noll [Mon, 14 Sep 2009 08:08:38 +0000 (10:08 +0200)]
Minor documentation fixes.

14 years agoFEC timing improvements.
Andre Noll [Sat, 12 Sep 2009 16:16:56 +0000 (18:16 +0200)]
FEC timing improvements.

Currently we compute the time of a FEC group as the number of
containing chunks times the chunk time. The time between sending
two slices therefore depends only on the number of chunks the group
contains. Groups containing many slices are sent with larger delays
than groups containing few slices.

This approach is not optimal for the following reason: Consider a group
containing only few slices which is followed by a group containing
many slices. This happens frequently at the end of VBR MP3 files which
contain some seconds of silence or applause at the end because this
last part is often encoded at a lower bitrate than the preceding part.

In this scenario buffer underruns in the receiving application can
easily occur if the previous FEC group has been decoded and completely
fed to the writer before enough slices of the next group have arrived
to decode the second group.

This patch changes the timing of FEC groups such that all but the
first group use the duration of the _previous_ group as the basis
for the timing.

14 years agovss_send(): Fix EOF-check for FEC clients.
Andre Noll [Sat, 12 Sep 2009 16:13:36 +0000 (18:13 +0200)]
vss_send(): Fix EOF-check for FEC clients.

If the last chunk has been sent to all http/dccp clients we have
to wait until the last FEC group has been sent before setting the
NEXT flag that causes all senders to shut down its clients. The old
code tested if a slice was sent to any FEC  client during vss_send()
and set the NEXT flag if nothing was sent.

However, this is not sufficient as there may be still slices available
which have to be sent at some future time. This patch teaches
vss_send() to detect this condition. It also renames the boolean
variable sent_something to fec_active, which is more to the point.

14 years agomood: Do not handle events if no mood is active.
Andre Noll [Sun, 6 Sep 2009 20:23:45 +0000 (22:23 +0200)]
mood: Do not handle events if no mood is active.

In case a file is being removed with "para_client rm" while in playlist mode,
the following assertion triggers:

mood.c:521: del_afs_statistics: Assertion `n' failed.

This happens because the file is contained in the score table but statistics are not enabled.
Fix it by ignoring events if cuurent_mood is NULL.

14 years agofilter: Register the filter chain as the last task.
Andre Noll [Sun, 6 Sep 2009 20:19:31 +0000 (22:19 +0200)]
filter: Register the filter chain as the last task.

Without this patch, the command

para_filter -f mp3dec < foo.mp3 > /dev/null

would take several minutes because the stdin buffer is usually full and the stdout buffer empty
which causes select() to be called with empty fd sets, resulting in a one second timeout.

14 years agofade: Avoid a gcc warning.
Andre Noll [Wed, 2 Sep 2009 11:59:54 +0000 (13:59 +0200)]
fade: Avoid a gcc warning.

The following warning is harmless and gcc is just being stupid:

fade.c: In function 'main':
fade.c:111: warning: 'val' may be used uninitialized in this function
fade.c:111: note: 'val' was declared here

14 years agoKill the quick hack that changed timing for the first fec goup.
Andre Noll [Mon, 31 Aug 2009 19:26:54 +0000 (21:26 +0200)]
Kill the quick hack that changed timing for the first fec goup.

This did never really work.

14 years agomp3dec: Improve bad main_data_begin pointer error handling.
Andre Noll [Mon, 31 Aug 2009 19:17:21 +0000 (21:17 +0200)]
mp3dec: Improve bad main_data_begin pointer error handling.

These errors from mad_frame_decode() are non-fatal and happen if the
stream is started at the middle of the file, e.g. when para_audiod
is started while para_server is already streaming.

If libmad encounters such an error it throws away the first (and
probably the second) frame which messes up the timing in udp/fec mode,
causing an audible buffer underrun after the remaining frames of the
first fec group have been decoded and fed to the writer.

This patch makes the mp3dec filter keep track of bad main_data_begin
pointer errors that happen at the start of the stream. In this case
decoding is deferred until more data has arrived or 60ms have passed.

14 years agocom_stat(): Be more anal in checking command line options.
Andre Noll [Sun, 30 Aug 2009 12:26:32 +0000 (14:26 +0200)]
com_stat(): Be more anal in checking command line options.

Also check the number of arguments and use para_atoi32 to convert
the argument into an int.

14 years agoFix off-by-one bug in fixup_info_string().
Andre Noll [Sun, 30 Aug 2009 11:20:14 +0000 (13:20 +0200)]
Fix off-by-one bug in fixup_info_string().

This caused the chunk time not being properly displayed due to a
missing newline in the status output.

14 years agoNEWS update.
Andre Noll [Sat, 29 Aug 2009 20:28:41 +0000 (22:28 +0200)]
NEWS update.

14 years agoAlsa timing improvements.
Andre Noll [Sat, 29 Aug 2009 20:17:55 +0000 (22:17 +0200)]
Alsa timing improvements.

This moves the computation of the select timeout from
alsa_write_post_select() to alsa_write_pre_select(). The code now
computes when the next buffer underrun would occur and uses that
value to set the timeout for the next select call. This decreases
the number of writes to the alsa handle and therefore also the CPU
usage of para_write/para_audiod.

14 years agodaemon: Don't set the umask to zero.
Andre Noll [Fri, 21 Aug 2009 19:30:23 +0000 (21:30 +0200)]
daemon: Don't set the umask to zero.

Clearing umask creates more problems that it solves.

14 years agoFix two typos in daemon.c.
Andre Noll [Fri, 21 Aug 2009 19:08:29 +0000 (21:08 +0200)]
Fix two typos in daemon.c.

14 years agoMerge commit 'meins/master'
Andre Noll [Mon, 3 Aug 2009 14:00:31 +0000 (16:00 +0200)]
Merge commit 'meins/master'

14 years ago[filter]: Do filter conversion during post_select.
Andre Noll [Sun, 2 Aug 2009 13:29:47 +0000 (15:29 +0200)]
[filter]: Do filter conversion during post_select.

This is more natural and allows to get rid of the hack that
forced a minimal timout in case something was converted.

14 years agoPrint an error message if the filter config file contains invalid options.
Andre Noll [Sat, 25 Jul 2009 16:29:06 +0000 (18:29 +0200)]
Print an error message if the filter config file contains invalid options.

14 years agoTeach para_fade to accept a mixer channel to fade.
Andre Noll [Sat, 25 Jul 2009 13:51:48 +0000 (15:51 +0200)]
Teach para_fade to accept a mixer channel to fade.

This allows to fade not only the volume channel but all other channels that are
supported by oss.

14 years agoKill unused para_reap_children().
Andre Noll [Mon, 20 Jul 2009 16:54:15 +0000 (18:54 +0200)]
Kill unused para_reap_children().

Found by cppcheck.

14 years agoFix memory leaks in [alsa,file,oss]write.c.
Andre Noll [Sun, 19 Jul 2009 12:16:42 +0000 (14:16 +0200)]
Fix memory leaks in [alsa,file,oss]write.c.

Small and harmless but anyway.

14 years agoRemove unused label "out".
Andre Noll [Sat, 18 Jul 2009 13:40:39 +0000 (15:40 +0200)]
Remove unused label "out".

14 years agoaudiod: Clean up status output.
Andre Noll [Sat, 18 Jul 2009 13:19:24 +0000 (15:19 +0200)]
audiod: Clean up status output.

It's a mess. Fortunately, this is much cleaner in 0.4.x..

14 years agoaudiod: Properly prefix uptime string.
Andre Noll [Sat, 18 Jul 2009 12:57:15 +0000 (14:57 +0200)]
audiod: Properly prefix uptime string.

The prefix was missing the first time the uptime was printed in the status output.

14 years agoaudiod: Fix some memory leaks in the com_stat() error paths.
Andre Noll [Sat, 18 Jul 2009 12:22:25 +0000 (14:22 +0200)]
audiod: Fix some memory leaks in the com_stat() error paths.

14 years agoFix a memory leak in filter.c.
Andre Noll [Sat, 18 Jul 2009 12:00:17 +0000 (14:00 +0200)]
Fix a memory leak in filter.c.

We must free the filter configs as well.

14 years agoFix a typo in the udp_recv help.
Andre Noll [Sat, 18 Jul 2009 10:26:04 +0000 (12:26 +0200)]
Fix a typo in the udp_recv help.

14 years agoFix memory leaks in xxx_recv_init().
Andre Noll [Sat, 18 Jul 2009 10:25:39 +0000 (12:25 +0200)]
Fix memory leaks in xxx_recv_init().

Not serious but it's good to make valgrind happy.

14 years agoMake RSA keys larger than 512 bit work.
Andre Noll [Sat, 18 Jul 2009 09:30:24 +0000 (11:30 +0200)]
Make RSA keys larger than 512 bit work.

This allows to use the 2048 bit keys which are necessary for paraslash-0.4.x also for
paraslash-0.3.5.

14 years agoFix com_init() in case arguments are given.
Andre Noll [Sat, 11 Jul 2009 19:01:27 +0000 (21:01 +0200)]
Fix com_init() in case arguments are given.

As the ->name field of struct afs_table was only initialized in the afs process,
com_init(), which gets forked from the server process, did not see the table
names and would segfault due to a NULL pointer dereference if table names
were given as arguments.

Fix it by initializing the ->name fields in the definition of the afs_tables array.

This bug was introduced in commit 53d503ce back in 2007...

14 years agoScoring fixes.
Andre Noll [Sat, 11 Jul 2009 14:53:50 +0000 (16:53 +0200)]
Scoring fixes.

Rename add_item_score to get_item_score(), properly check its return value,
and use the computed score only for admissible files.

14 years agofade.c: Fix a gcc warning on FreeBSD.
Andre Noll [Tue, 7 Jul 2009 13:53:59 +0000 (15:53 +0200)]
fade.c: Fix a gcc warning on FreeBSD.

fade.c:220: warning: long unsigned int format, time_t arg (arg 4)

14 years agorecv/filter: Init loglevel earlier.
Andre Noll [Sun, 5 Jul 2009 21:26:54 +0000 (23:26 +0200)]
recv/filter: Init loglevel earlier.

This avoids that early debug messages are always printed.

14 years agoFix a bug in the output of para_audioc.
Andre Noll [Sun, 5 Jul 2009 08:40:55 +0000 (10:40 +0200)]
Fix a bug in the output of para_audioc.

This bites In case of short writes to stdout. The bug was literally there since day one
but never showed up as short writes usually don't happen with the rather small amount
of data that is written by para_audioc.

14 years agoINSTALL: Fix the help text on how to create the RSA key pair.
Andre Noll [Sat, 4 Jul 2009 21:21:56 +0000 (23:21 +0200)]
INSTALL: Fix the help text on how to create the RSA key pair.

Some day, I will write a user-friendly script that generates the keys...

14 years agoNEWS update.
Andre Noll [Sat, 4 Jul 2009 14:24:25 +0000 (16:24 +0200)]
NEWS update.

14 years agoaudioc stat: Remove __a_unused attributes from com_stat().
Andre Noll [Sat, 4 Jul 2009 14:22:44 +0000 (16:22 +0200)]
audioc stat: Remove __a_unused attributes from com_stat().

argc and argv _are_ used.

14 years agoaudioc stat: Make status item mask 64 bits wide.
Andre Noll [Sat, 4 Jul 2009 14:21:36 +0000 (16:21 +0200)]
audioc stat: Make status item mask 64 bits wide.

We already have more than 32 status items.

14 years agoMerge commit 'fml/master'
Andre Noll [Sat, 4 Jul 2009 13:53:43 +0000 (15:53 +0200)]
Merge commit 'fml/master'

14 years agoSupport netmask subsets
Gerrit Renker [Tue, 30 Jun 2009 08:20:19 +0000 (10:20 +0200)]
Support netmask subsets

This allows to specify sets of addresses which are defined by sharing
the least-common netmask value.

For example, if the allow list contains the following addresses:

        10.0.0.2/24  10.0.0.2/32

then the second address is redundant since it is already included
via the first one. The least-common netmask value is 24; with this
patch a command like

        para_client sender http deny 10.0.0.0/24

will catch both addresses.

14 years agoMake allow/deny syntax consistent with that of add/delete
Gerrit Renker [Tue, 30 Jun 2009 08:17:16 +0000 (10:17 +0200)]
Make allow/deny syntax consistent with that of add/delete

After the changes for the add/delete commands, this patch updates
allow/deny to use the same syntax and (almost) the same code.

14 years agoUpdate to gengetopt 2.22.2.
Andre Noll [Sun, 21 Jun 2009 10:12:28 +0000 (12:12 +0200)]
Update to gengetopt 2.22.2.

This introduced a new gcc warning which is fixed by this patch.