paraslash.git
11 years agoFix the --log_color option of para_server and para_audiod.
Andre Noll [Sun, 10 May 2009 20:55:20 +0000 (22:55 +0200)]
Fix the --log_color option of para_server and para_audiod.

11 years agorbtree: Add const qualifier to some functions.
Andre Noll [Sun, 10 May 2009 19:31:13 +0000 (21:31 +0200)]
rbtree: Add const qualifier to some functions.

The 'rb_first()', 'rb_last()', 'rb_next()' and 'rb_prev()' calls take a pointer
to an RB node or RB root. They do not change the pointed objects, so add a
'const' qualifier.

See commit f4b477c47332367d35686bd2b808c2156b96d7c7 in the linux source tree.

11 years agoAdd some missing source code documentation.
Andre Noll [Sun, 10 May 2009 18:41:11 +0000 (20:41 +0200)]
Add some missing source code documentation.

11 years agoAdd ggo/.gitignore to hide derived ggo files.
Andre Noll [Sun, 10 May 2009 16:11:30 +0000 (18:11 +0200)]
Add ggo/.gitignore to hide derived ggo files.

11 years agoAdd new prebuffer filter.
Andre Noll [Sun, 10 May 2009 15:46:40 +0000 (17:46 +0200)]
Add new prebuffer filter.

This could be handy for lossy networks that require a lot of buffering
in addition to methods (like FEC) to cope with packet loss.

11 years agofilter: Force a minimal select timeout if something was converted.
Andre Noll [Sun, 10 May 2009 15:40:42 +0000 (17:40 +0200)]
filter: Force a minimal select timeout if something was converted.

When filter_preselect() runs. other pre_select functions might have
already been called and decided to do nothing, e.g. because their
output buffer was full or the input buffer was empty.

If this call to filter_preselect() changed any of the involved buffers,
we want those other pre_select() functions to be called ASAP. So force
a minimal timeout for the next select call to avoid unnecessary delays.

11 years agomp3dec: Try harder to recover from non-fatal errors.
Andre Noll [Sun, 10 May 2009 13:28:13 +0000 (15:28 +0200)]
mp3dec: Try harder to recover from non-fatal errors.

If there's still data left, try to decode the next header in the
same scheduler run. This avoids unnecessary copies of large parts
of the mp3 input buffer.

11 years agoaudiod: Properly handle wng open failures.
Andre Noll [Sun, 10 May 2009 12:11:38 +0000 (14:11 +0200)]
audiod: Properly handle wng open failures.

If opening the writer node group fails, no task is being registered to the
scheduler although a task structure is allocated. This makes audiod think
everything is fine until the output buffer of the receiver or a filter is
filled up which may take several seconds.

Fix this flaw by setting the error field of the wng to -E_TASK_UNREGISTERED.
This causes audiod to close the receiver node and the filter chain and to
clear the affected slot.

11 years agoFirst draft of the oss writer.
Andre Noll [Sat, 9 May 2009 08:59:14 +0000 (10:59 +0200)]
First draft of the oss writer.

This adds client-side support for FreeBSD and NetBSD and provides an
alternative writer for Linux.

11 years agoAllow writers that have no pre_select functions.
Andre Noll [Fri, 8 May 2009 19:49:30 +0000 (21:49 +0200)]
Allow writers that have no pre_select functions.

Also, fix the pointer being printed in a debug message of the scheduler.

11 years agoNEWS update.
Andre Noll [Fri, 8 May 2009 08:04:11 +0000 (10:04 +0200)]
NEWS update.

11 years agoMerge branch 'next'
Andre Noll [Thu, 7 May 2009 17:03:49 +0000 (19:03 +0200)]
Merge branch 'next'

11 years agonew codename, reset version to git
Andre Noll [Thu, 7 May 2009 15:46:15 +0000 (17:46 +0200)]
new codename, reset version to git

11 years agothe paraslash-0.3.4 release tarball
Andre Noll [Thu, 7 May 2009 15:38:49 +0000 (17:38 +0200)]
the paraslash-0.3.4 release tarball

11 years agoparaslash 0.3.4 v0.3.4
Andre Noll [Thu, 7 May 2009 15:35:34 +0000 (17:35 +0200)]
paraslash 0.3.4

11 years agoRemove an overambitious sanity check in the fecdec filter.
Andre Noll [Thu, 7 May 2009 14:44:57 +0000 (16:44 +0200)]
Remove an overambitious sanity check in the fecdec filter.

11 years agoKill a bashism in configure.ac.
Andre Noll [Mon, 4 May 2009 14:23:04 +0000 (16:23 +0200)]
Kill a bashism in configure.ac.

This caused additional quotes when /bin/sh is dash or tcsh which would result
in syntax errors during compilation.

11 years agoFix compilation on FreeBSD.
Andre Noll [Mon, 4 May 2009 11:34:16 +0000 (13:34 +0200)]
Fix compilation on FreeBSD.

Without these two includes, compilation fails on FreeBSD with

/usr/include/net/if.h:265: error: field `ifru_addr' has incomplete type
/usr/include/net/if.h:266: error: field `ifru_dstaddr' has incomplete type
/usr/include/net/if.h:267: error: field `ifru_broadaddr' has incomplete type
/usr/include/net/if.h:299: error: field `ifra_addr' has incomplete type
/usr/include/net/if.h:300: error: field `ifra_broadaddr' has incomplete type
/usr/include/net/if.h:301: error: field `ifra_mask' has incomplete type
/usr/include/net/if.h:368: error: field `addr' has incomplete type
/usr/include/net/if.h:369: error: field `dstaddr' has incomplete type

11 years agoFix two gcc warnings.
Andre Noll [Mon, 4 May 2009 11:12:17 +0000 (13:12 +0200)]
Fix two gcc warnings.

mp3_afh.c:420: warning: comparison of distinct pointer types lacks a cast
alsa_write.c:119: warning: format '%zu' expects type 'size_t', but argument 4 has type 'int'

11 years agoMerge branch 'master' into next
Andre Noll [Sun, 3 May 2009 17:09:16 +0000 (19:09 +0200)]
Merge branch 'master' into next

11 years agoAlsa fixes and cleanups.
Andre Noll [Sun, 3 May 2009 16:11:22 +0000 (18:11 +0200)]
Alsa fixes and cleanups.

This patch

- replaces the unused E_SND_PCM_INFO error by E_PHYSICAL_WIDTH,

- checks the return value of snd_pcm_format_physical_width() and returns
  -E_PHYSICAL_WIDTH if this causes bytes_per_frame being non-positive,

- introduces an upper bound for the start threshold. Without that
  change, playback could be delayed by several seconds on some alsa
  configurations (problem pointed out by Johannes Wörner, thanks).

- does not return early on input errors which could cause the last
  part of the audio stream being skipped.

- avoids calling snd_pcm_writei() with a frame count of zero which
  could happen with the old code in case there's more than zero but
  less than a full frame of audio data available.

- cleans up the documentation of struct private_alsa_write_data

11 years agoRe-revert "Auto-adjust fecdec output buffer size."
Andre Noll [Sat, 2 May 2009 10:53:54 +0000 (12:53 +0200)]
Re-revert "Auto-adjust fecdec output buffer size."

This re-applies commit 35f9051506345255c7ed3c076b7df5f3b7d26039 which
should work due to the previous output buffer patch.

11 years agoMerge branch 'master' into next
Andre Noll [Sat, 2 May 2009 09:50:17 +0000 (11:50 +0200)]
Merge branch 'master' into next

11 years agoUse only a single buffer pointer for filters/receivers.
Andre Noll [Sat, 2 May 2009 09:46:46 +0000 (11:46 +0200)]
Use only a single buffer pointer for filters/receivers.

This allows filters to change the output buffer size on the fly.

11 years agofecdec: Add another sanity check to find_group().
Andre Noll [Fri, 1 May 2009 20:07:49 +0000 (22:07 +0200)]
fecdec: Add another sanity check to find_group().

11 years agoalsa: Do not call alsa shutdown functions if alsa wasn't yet initialized.
Andre Noll [Fri, 1 May 2009 12:05:47 +0000 (14:05 +0200)]
alsa: Do not call alsa shutdown functions if alsa wasn't yet initialized.

This might happen if the wng is destroyed before any output was
produced. This bug could trigger

para_audiod: pcm.c:1105: snd_pcm_drain: Assertion `pcm' failed

causing audiod to crash.

11 years agoalsa: Fix a typo in comment.
Andre Noll [Fri, 1 May 2009 11:51:33 +0000 (13:51 +0200)]
alsa: Fix a typo in comment.

11 years agofecdec: Be more anal when finding fec groups.
Andre Noll [Fri, 1 May 2009 11:42:21 +0000 (13:42 +0200)]
fecdec: Be more anal when finding fec groups.

If the number of (data) slices changes, there's something seriously
wrong. So return an error if we detect this situation.

11 years agofecdec: Fix warning message when freeing incomplete groups.
Andre Noll [Fri, 1 May 2009 11:35:54 +0000 (13:35 +0200)]
fecdec: Fix warning message when freeing incomplete groups.

This could lead to a segfault.

11 years ago[client] Dynamically allocate output buffer.
Andre Noll [Wed, 29 Apr 2009 19:26:00 +0000 (21:26 +0200)]
[client] Dynamically allocate output buffer.

This should simplify subsequent patches that allow variable-sized
output buffers for filters/receivers.

11 years agoMerge branch 'master' into next
Andre Noll [Mon, 27 Apr 2009 18:26:34 +0000 (20:26 +0200)]
Merge branch 'master' into next

11 years agoRevert "Auto-adjust fecdec output buffer size."
Andre Noll [Sun, 26 Apr 2009 20:35:53 +0000 (22:35 +0200)]
Revert "Auto-adjust fecdec output buffer size."

This reverts commit 35f9051506345255c7ed3c076b7df5f3b7d26039.

Currently, filters must not change their output buffer on the fly
because the writer might already have a reference to the old buffer
and keeps using this buffer.

As dealing with changing output buffers requires much more work,
including changes to the generic filter and writer code, let's defer
this change to post 0.3.4.

11 years agoMerge branch 'master' into next
Andre Noll [Sun, 26 Apr 2009 19:05:18 +0000 (21:05 +0200)]
Merge branch 'master' into next

11 years agoafs: Rename signal_post_select() to afs_signal_post_select().
Andre Noll [Sun, 26 Apr 2009 17:48:40 +0000 (19:48 +0200)]
afs: Rename signal_post_select() to afs_signal_post_select().

Just to distinguish the fatal error messages on shutdown.

11 years agoAvoid dirty afs tables on shutdown.
Andre Noll [Sun, 26 Apr 2009 17:45:59 +0000 (19:45 +0200)]
Avoid dirty afs tables on shutdown.

The server process must wait for afs because afs catches SIGINT/SIGTERM
and may thus not respond immediately to these SIGNALS.

Before reacting to the signal, afs might want to use the shared memory
area and the mmd mutex.  If the server process destroys this mutex
too early and afs tries to lock the shared memory area, the call to
mutex_lock() will fail and terminate the afs process. This leads to
dirty osl tables.

There's no such problem with the other children of the server process
(the command handlers) as these reset their SIGINT/SIGTERM handlers
to the default action, i.e.  these processes get killed immediately
by the above kill().

11 years agoFix an invalid free() in command handlers.
Andre Noll [Sun, 26 Apr 2009 16:08:13 +0000 (18:08 +0200)]
Fix an invalid free() in command handlers.

The chunk table and the info_string are pointers located in the mmd
struct that point to dynamically allocated memory that must be freed
by the parent and the child. However, as the mmd struct is in a shared
memory area, there's no guarantee that after the fork these pointers
are still valid in child context. As these two pointers are not used
in the child anyway, we save them to local variables and free the
memory via that copy in the child.

This gets rid of

*** glibc detected *** para_server (serving 127.0.0.1#53650): double free or corruption (!prev): 0x08086fe0 ***

11 years agoMerge branch 'master' into next
Andre Noll [Sat, 25 Apr 2009 20:33:43 +0000 (22:33 +0200)]
Merge branch 'master' into next

Conflicts:
mp3_afh.c

11 years ago[net]: Fix buffer overflow in send_cred_buffer().
Andre Noll [Sat, 25 Apr 2009 13:17:58 +0000 (15:17 +0200)]
[net]: Fix buffer overflow in send_cred_buffer().

As pointed out by Johannes Wörner, para_audioc crashes on recent
Ubuntu systems due to stack smashing. This is caused by writing past
the end of the control buffer which stores the message header and
the socket credentials.

This patch fixes the bug by allocating a properly sized buffer.

11 years agoMerge commit 'fml/master'
Andre Noll [Thu, 23 Apr 2009 21:26:23 +0000 (23:26 +0200)]
Merge commit 'fml/master'

11 years ago[udp_send] Refuse to stream files with invalid chunk tables.
Andre Noll [Thu, 23 Apr 2009 15:18:03 +0000 (17:18 +0200)]
[udp_send] Refuse to stream files with invalid chunk tables.

If an audio file contains a chunk so large that even the maximal
possible number of slices is not sufficient to put this chunk into
a single FEC group, we must refuse to send this file. It's likely a
corrupt file anyway.

The old code in num_slices() was buggy as it returned the number of
slices needed to send the file as an uint8_t, so the return value
was actually the number of needed slices mod 256. This could trigger
the assert() in setup_next_fec_group() which checks that the group
contains at least one chunk.

This patch changes num_slices() to detect this situation more
reliably. As it is likely caused by a bad audio file rather than by a
networking problem, we do _not_ kick the fec client, but deactivate
it for the current file only. This requires the new "error" member
of struct fec_client which indicates a temporarily disabled fec client.

11 years ago[mp3_afh]: Ignore junk at the end of an mp3 file.
Andre Noll [Thu, 23 Apr 2009 11:39:04 +0000 (13:39 +0200)]
[mp3_afh]: Ignore junk at the end of an mp3 file.

There are mp3 files containing large areas of zeros at the end of the
file. The old code in mp3_afh.c would include these zeros in the last
chunk of the file.

This leads to unnecessary network traffic as including this area in
a chunk means that useless data is going to be sent to the client.
More importantly, it causes the udp sender to bail out because such
large chunks can not be fec-encoded, even with the maximal number
of slices.

This patch uses frame_start+frame_length instead of the file size as
the end of the last chunk which avoids this particular problem.

11 years agoMerge commit 'athcx/next' into next
Andre Noll [Sun, 19 Apr 2009 21:17:38 +0000 (23:17 +0200)]
Merge commit 'athcx/next' into next

11 years agoFix off-by-one bug in mp3_afh.
Andre Noll [Sun, 19 Apr 2009 21:17:08 +0000 (23:17 +0200)]
Fix off-by-one bug in mp3_afh.

11 years agoaudiod: Add more detailed docu on when to use --no_default_filters.
Andre Noll [Wed, 8 Apr 2009 14:47:52 +0000 (16:47 +0200)]
audiod: Add more detailed docu on when to use --no_default_filters.

11 years agoKill remaining instances of signal().
Andre Noll [Mon, 6 Apr 2009 17:02:16 +0000 (19:02 +0200)]
Kill remaining instances of signal().

Also, make para_sigaction() and para_install_sighandler() return void
and exit on errors.

11 years agoserver: Use para_sigaction() to install the temporary SIGCHLD handler.
Andre Noll [Mon, 6 Apr 2009 16:54:15 +0000 (18:54 +0200)]
server: Use para_sigaction() to install the temporary SIGCHLD handler.

11 years agoUse para_sigaction() in command handlers.
Andre Noll [Mon, 6 Apr 2009 16:41:37 +0000 (18:41 +0200)]
Use para_sigaction() in command handlers.

This allows to get rid of an ugly hack for solaris. The patch also adds checks
for whether the signals were reset sucessfully in the command handler and
aborts early on errors.

11 years agoIntroduce para_sigaction().
Andre Noll [Mon, 6 Apr 2009 15:53:46 +0000 (17:53 +0200)]
Introduce para_sigaction().

This wrapper for sigaction() is public and may be used to setup
a handler different from the generic handler that gets installed
for the signal by para_install_sighandler().

11 years agosignal: Switch from signal() to sigaction.
Andre Noll [Mon, 6 Apr 2009 15:45:44 +0000 (17:45 +0200)]
signal: Switch from signal() to sigaction.

Use of signal() should be avoided because the behavior of signal() varies
across Unix versions, and has also varied historically across different
versions of Linux.

This patch rewrites para_install_sighandler so that it calls sigaction()
instead of signal(). The implementation is taken from good old APUE.

There are a couple of other users of signal() in the paraslash code. Most
of which are OK because they use signal() only to ignore/reset a signal which
happens to be the only portable use of signal(). All other users of signal()
have to be converted in subsequent patches.

11 years agoAuto-adjust fecdec output buffer size.
Andre Noll [Sat, 28 Mar 2009 18:15:01 +0000 (19:15 +0100)]
Auto-adjust fecdec output buffer size.

11 years agoFix a memory leak in the fecdec filter.
Andre Noll [Sat, 28 Mar 2009 18:13:56 +0000 (19:13 +0100)]
Fix a memory leak in the fecdec filter.

11 years agofecdec: Return an error on zero size slices.
Andre Noll [Sat, 28 Mar 2009 18:13:23 +0000 (19:13 +0100)]
fecdec: Return an error on zero size slices.

11 years agoINSTALL: Minor improvements.
Andre Noll [Sun, 22 Mar 2009 18:53:27 +0000 (19:53 +0100)]
INSTALL: Minor improvements.

11 years agoFix some memory leaks.
Andre Noll [Sun, 22 Mar 2009 12:58:28 +0000 (13:58 +0100)]
Fix some memory leaks.

In fact, there was only one "real" leak: An empty info string (100
bytes) could leak on file change.

11 years agoDestroy the close_on_fork_list in close_listed_fds().
Andre Noll [Sun, 22 Mar 2009 11:23:21 +0000 (12:23 +0100)]
Destroy the close_on_fork_list in close_listed_fds().

This is called from child context and the child does no longer
need the list once all fds have been closed.

11 years agoserver: Use a temporary SIGCHLD handler to catch afs init failures.
Andre Noll [Sat, 21 Mar 2009 16:46:43 +0000 (17:46 +0100)]
server: Use a temporary SIGCHLD handler to catch afs init failures.

If afs dies immediately on startup (because of dirty tables) para_server
would not notice as the SIGCHLD handler is being intalled after the
call to afs_init().

11 years agoaudiod: Improve display of play time.
Andre Noll [Thu, 19 Mar 2009 21:51:17 +0000 (22:51 +0100)]
audiod: Improve display of play time.

Keeping track of the offset, server stream start and the duration
of the audio file length at the time the receiver/writer was started
allows to compute the play time more accurately.

11 years agoFix various dead stores found by the clang static analyzer.
Andre Noll [Wed, 18 Mar 2009 22:05:22 +0000 (23:05 +0100)]
Fix various dead stores found by the clang static analyzer.

11 years agoudp_send: Also mention the FEC parameters of all targets.
Andre Noll [Wed, 18 Mar 2009 19:16:03 +0000 (20:16 +0100)]
udp_send: Also mention the FEC parameters of all targets.

11 years agowav: Replace assertion by a proper error message.
Andre Noll [Wed, 18 Mar 2009 19:15:27 +0000 (20:15 +0100)]
wav: Replace assertion by a proper error message.

This assertion can be hit easily by choosing wav as the first filter
of the filter chain.

11 years agoGET_NUM_DIGITS: Evaluate macro parameter only once.
Andre Noll [Tue, 17 Mar 2009 23:00:08 +0000 (00:00 +0100)]
GET_NUM_DIGITS: Evaluate macro parameter only once.

11 years agoFix possible NULL pointer dereference in afh_get_header().
Andre Noll [Tue, 17 Mar 2009 22:58:58 +0000 (23:58 +0100)]
Fix possible NULL pointer dereference in afh_get_header().

11 years agomp3: Avoid rounding errors during bitrate calculation.
Andre Noll [Sun, 15 Mar 2009 17:59:48 +0000 (18:59 +0100)]
mp3: Avoid rounding errors during bitrate calculation.

Just add up the bitrates of all frames and divide by the number
of frames afterwards. By using uint64_t for the sum, we should
be safe wrt. overflows.

11 years agoFix year in comment to color.c.
Andre Noll [Sun, 15 Mar 2009 16:36:19 +0000 (17:36 +0100)]
Fix year in comment to color.c.

The code was actually stolen this year :)

11 years agoalsa: Split alsa_open().
Andre Noll [Sun, 15 Mar 2009 16:35:37 +0000 (17:35 +0100)]
alsa: Split alsa_open().

Only perform what is absolutely necessary in alsa_open(). Call the
real alsa initialization from alsa_post_select(), when we actually
have audio data available to start streaming.

This should get rid of the sound artefacts that happen sometimes
at the beginning of the stream.

11 years agowrite: Get rid of wn->chunk_bytes and wng->max_chunk_bytes.
Andre Noll [Sun, 15 Mar 2009 16:14:50 +0000 (17:14 +0100)]
write: Get rid of wn->chunk_bytes and wng->max_chunk_bytes.

These are not used anyway. Make all writers return 1 on success.

11 years agoMinor documentation updates.
Andre Noll [Sun, 15 Mar 2009 16:08:14 +0000 (17:08 +0100)]
Minor documentation updates.

11 years agoalsa: Simplify alsa_open().
Andre Noll [Sun, 15 Mar 2009 14:47:45 +0000 (15:47 +0100)]
alsa: Simplify alsa_open().

No need to call snd_pcm_info() as we do not use it anyway.

11 years agoaudiod: Improve receiver restart logic.
Andre Noll [Sun, 15 Mar 2009 14:29:12 +0000 (15:29 +0100)]
audiod: Improve receiver restart logic.

Use the vss status flags and the stream_start time announced by
para_server to decide when to start a new receiver.

This is better than basing this decision only on whether the vss status
equals "playing" as we did before. This allows to reliably detect when it
is safe to start a new receiver while the filter/writer of the current
stream are still active.

The old code would simply wait until filter/writer complete which, due to
buffering, might be much too late.

11 years agovss: Take fec group durations into account when computing the eof barrier.
Andre Noll [Thu, 12 Mar 2009 20:39:59 +0000 (21:39 +0100)]
vss: Take fec group durations into account when computing the eof barrier.

On eof, we must wait at least as long as the duration of the last sent
fec group.

11 years agoFix a typo in the documentation to struct writer.
Andre Noll [Thu, 12 Mar 2009 20:38:07 +0000 (21:38 +0100)]
Fix a typo in the documentation to struct writer.

11 years agoalsa: Revert 596d1d97f90854bd941db02f1353df8e1196ccc0
Andre Noll [Thu, 12 Mar 2009 20:37:26 +0000 (21:37 +0100)]
alsa: Revert 596d1d97f90854bd941db02f1353df8e1196ccc0

This was really a brain fart. Instead, introduce a small delay
in alsa_open() that defers audio data writing by 100ms. This seems
to be enough to get rid of the buffer underruns with the udp sender.

11 years agoaudiod: Change return value of open_current_receiver() to void.
Andre Noll [Mon, 9 Mar 2009 21:43:04 +0000 (22:43 +0100)]
audiod: Change return value of open_current_receiver() to void.

Its single caller ignores the return value.

11 years agoMove struct status_task from audiod.h to audiod.c.
Andre Noll [Mon, 9 Mar 2009 21:35:11 +0000 (22:35 +0100)]
Move struct status_task from audiod.h to audiod.c.

It's only used in audiod.c.

11 years agovss: Fix need_audio_header().
Andre Noll [Mon, 9 Mar 2009 21:01:33 +0000 (22:01 +0100)]
vss: Fix need_audio_header().

This braino caused the audio file header to be included in each FEC group.

11 years agovss: Improve EOF handling.
Andre Noll [Mon, 9 Mar 2009 20:55:50 +0000 (21:55 +0100)]
vss: Improve EOF handling.

Set the "next" flag only if no more writes to fec clients happen.

11 years agovss: Handle errors in setup_next_fec_group() properly.
Andre Noll [Mon, 9 Mar 2009 20:41:36 +0000 (21:41 +0100)]
vss: Handle errors in setup_next_fec_group() properly.

setup_next_fec_group() might return a negative value.

11 years agorecv_afs_msg(): Fix indentation.
Andre Noll [Mon, 9 Mar 2009 20:29:27 +0000 (21:29 +0100)]
recv_afs_msg(): Fix indentation.

11 years agoMake FEC work with oggvorbis streams.
Andre Noll [Sun, 8 Mar 2009 20:41:27 +0000 (21:41 +0100)]
Make FEC work with oggvorbis streams.

Unfortunately, this required to rewrite large parts of the fec code
in vss.c. The new code behaves better if the FEC parameters are not
suitable for the current audio file, for example if the audio file header
does not fit into the desired number of slices. It detects this situation
and adjusts the given FEC parameters accordingly.

11 years agoafh: Introduce afh_get_largest_chunk_size().
Andre Noll [Sun, 8 Mar 2009 18:59:17 +0000 (19:59 +0100)]
afh: Introduce afh_get_largest_chunk_size().

This will be needed by the fec code in order to validate the
fec parameters.

11 years agooggdec: Abort on input errors.
Andre Noll [Sun, 8 Mar 2009 18:58:08 +0000 (19:58 +0100)]
oggdec: Abort on input errors.

11 years agofec: Fix comment to invert_mat().
Andre Noll [Sun, 8 Mar 2009 18:56:53 +0000 (19:56 +0100)]
fec: Fix comment to invert_mat().

11 years agoalsa_write: Handle EPIPE errors properly.
Andre Noll [Thu, 5 Mar 2009 21:05:22 +0000 (22:05 +0100)]
alsa_write: Handle EPIPE errors properly.

There's no need to throw away the data if a buffer underrun occurs.
Just try to write the same data again after the snd_pcm_prepare().

11 years agoAvoid division by zero in setup_next_fec_group().
Andre Noll [Thu, 5 Mar 2009 21:03:14 +0000 (22:03 +0100)]
Avoid division by zero in setup_next_fec_group().

This needs more work.

11 years agoFix initialization of fec_client_list.
Andre Noll [Thu, 5 Mar 2009 21:00:41 +0000 (22:00 +0100)]
Fix initialization of fec_client_list.

The list must be initialized _before_ the init functions of the
senders are called, because the udp_send_init() might add fec clients
to that list.

11 years agoNEWS, CREDITS, FEATURES update.
Andre Noll [Wed, 4 Mar 2009 21:58:23 +0000 (22:58 +0100)]
NEWS, CREDITS, FEATURES update.

11 years agoRecognize the eof packet also in the udp receiver.
Andre Noll [Wed, 4 Mar 2009 21:19:04 +0000 (22:19 +0100)]
Recognize the eof packet also in the udp receiver.

This fixes two bugs: The last fec group of an audio file was not
decoded at all, and "para_recv -r udp" did not exit at the end of
a multicast stream.

11 years agoFix some gcc warnings on x86_64.
Andre Noll [Mon, 2 Mar 2009 10:07:01 +0000 (11:07 +0100)]
Fix some gcc warnings on x86_64.

11 years agoMerge commit 'meins/master'
Andre Noll [Mon, 2 Mar 2009 09:39:59 +0000 (10:39 +0100)]
Merge commit 'meins/master'

11 years agovss.c: Improve the fec timing code.
Andre Noll [Sun, 1 Mar 2009 22:09:51 +0000 (23:09 +0100)]
vss.c: Improve the fec timing code.

This patch

- Fixes a the bug where assert(start_buf) caused para_server
to abort.
- Gets rid of buffer underruns by introducing a quick hack that
sends all but the first slice a bit early.
- Moves some code from compute_next_fec_slice() to
setup_next_fec_group() where it belongs.

11 years agoSimplify dispatch_slice().
Andre Noll [Sun, 1 Mar 2009 21:10:53 +0000 (22:10 +0100)]
Simplify dispatch_slice().

11 years agofecdec: Add some more documentation, minor improvements.
Andre Noll [Sun, 1 Mar 2009 21:08:23 +0000 (22:08 +0100)]
fecdec: Add some more documentation, minor improvements.

11 years agofecdec: Minor cleanups.
Andre Noll [Sun, 1 Mar 2009 20:54:24 +0000 (21:54 +0100)]
fecdec: Minor cleanups.

11 years agofecdec.c: Add some more sanity checks to find_group().
Andre Noll [Sun, 1 Mar 2009 20:09:37 +0000 (21:09 +0100)]
fecdec.c: Add some more sanity checks to find_group().

11 years agoMake fec parameters configurable.
Andre Noll [Sun, 1 Mar 2009 18:26:04 +0000 (19:26 +0100)]
Make fec parameters configurable.

This patch allows to specify the fec parameters in the add subcommand
like this:

para_client sender udp add 224.0.1.38:8000/1400:63:64

11 years agoMore source code documentation.
Andre Noll [Sun, 1 Mar 2009 13:57:52 +0000 (14:57 +0100)]
More source code documentation.

11 years agovss.h: Kill unused VSS_CHANGE.
Andre Noll [Sun, 1 Mar 2009 13:43:25 +0000 (14:43 +0100)]
vss.h: Kill unused VSS_CHANGE.

11 years agofecdec.c: Don't warn about incomplete slices at close time.
Andre Noll [Sun, 1 Mar 2009 13:42:39 +0000 (14:42 +0100)]
fecdec.c: Don't warn about incomplete slices at close time.

Move that warning to free_oldest_group().

11 years agofecdec_filter.c: Kill useless UNUSED_GROUP_NUM.
Andre Noll [Sun, 1 Mar 2009 13:00:40 +0000 (14:00 +0100)]
fecdec_filter.c: Kill useless UNUSED_GROUP_NUM.

A group is complete iff num_received_slices >= data_slices_per_group.

11 years agofecdec_filter cleanups and documentation improvements.
Andre Noll [Sun, 1 Mar 2009 12:55:29 +0000 (13:55 +0100)]
fecdec_filter cleanups and documentation improvements.

Rename struct fec_group to fecdec_group as we already have struct
fec_group in vss.c. Also kill useless INPUT_BUFFER_SIZE define.