paraslash.git
10 years agopass the buffer size to init_get_bits() in bytes.
Andre Noll [Sun, 18 Oct 2009 16:58:33 +0000 (18:58 +0200)]
pass the buffer size to init_get_bits() in bytes.

10 years agoRemove LAST_SKIP_BITS.
Andre Noll [Sun, 18 Oct 2009 16:37:09 +0000 (18:37 +0200)]
Remove LAST_SKIP_BITS.

10 years agoReplace GET_VLC by an inline funcion and kill get_vlc2().
Andre Noll [Sun, 18 Oct 2009 16:08:38 +0000 (18:08 +0200)]
Replace GET_VLC by an inline funcion and kill get_vlc2().

10 years agoRemove name parameter from GET_VLC.
Andre Noll [Sun, 18 Oct 2009 15:49:35 +0000 (17:49 +0200)]
Remove name parameter from GET_VLC.

10 years agoRemove unused show_bits().
Andre Noll [Sun, 18 Oct 2009 15:24:18 +0000 (17:24 +0200)]
Remove unused show_bits().

10 years agoKill unused getbit_context->size_in_bits and add some doku.
Andre Noll [Sun, 18 Oct 2009 13:46:07 +0000 (15:46 +0200)]
Kill unused getbit_context->size_in_bits and add some doku.

10 years agosave one level of indentation in build_table().
Andre Noll [Sun, 18 Oct 2009 13:28:06 +0000 (15:28 +0200)]
save one level of indentation in build_table().

10 years agoKill codes_wrap parameter from init_vlc().
Andre Noll [Sun, 18 Oct 2009 13:16:14 +0000 (15:16 +0200)]
Kill codes_wrap parameter from init_vlc().

10 years agomake init_vlc() return void.
Andre Noll [Sun, 18 Oct 2009 13:09:39 +0000 (15:09 +0200)]
make init_vlc() return void.

10 years agobitstream: Abort on invalid codes
Andre Noll [Sun, 18 Oct 2009 13:07:26 +0000 (15:07 +0200)]
bitstream: Abort on invalid codes

10 years agoSimplify alloc_table().
Andre Noll [Sun, 18 Oct 2009 11:39:28 +0000 (13:39 +0200)]
Simplify alloc_table().

10 years agoKill the bits_wrap and bits_size parameters of init_vlc().
Andre Noll [Sun, 18 Oct 2009 11:16:12 +0000 (13:16 +0200)]
Kill the bits_wrap and bits_size parameters of init_vlc().

10 years agoTrivial whitespace fixes.
Andre Noll [Sun, 18 Oct 2009 11:01:21 +0000 (13:01 +0200)]
Trivial whitespace fixes.

10 years agoUse para_realloc() instead of realloc() in alloc_table().
Andre Noll [Sun, 18 Oct 2009 10:53:43 +0000 (12:53 +0200)]
Use para_realloc() instead of realloc() in alloc_table().

10 years agoRemove some cruft from bitstream.h.
Andre Noll [Sun, 18 Oct 2009 10:33:05 +0000 (12:33 +0200)]
Remove some cruft from bitstream.h.

10 years agopass only one arg to wma_init().
Andre Noll [Sat, 17 Oct 2009 19:51:57 +0000 (21:51 +0200)]
pass only one arg to wma_init().

10 years agoAlways call struct private_wmadec_data pwd.
Andre Noll [Sat, 17 Oct 2009 19:48:40 +0000 (21:48 +0200)]
Always call struct private_wmadec_data pwd.

10 years agoChange name of private_wmadec_data parameter of wmadec_cleanup().
Andre Noll [Sat, 17 Oct 2009 16:04:53 +0000 (18:04 +0200)]
Change name of private_wmadec_data parameter of wmadec_cleanup().

10 years agoMake wmadec_cleanup() return void.
Andre Noll [Sat, 17 Oct 2009 16:02:38 +0000 (18:02 +0200)]
Make wmadec_cleanup() return void.

10 years agoMore whitespace cleanups.
Andre Noll [Sat, 17 Oct 2009 16:01:04 +0000 (18:01 +0200)]
More whitespace cleanups.

10 years agoAdd documenatation of imdct_init().
Andre Noll [Sat, 17 Oct 2009 15:51:04 +0000 (17:51 +0200)]
Add documenatation of imdct_init().

10 years agotrivial whitespace cleanups
Andre Noll [Sat, 17 Oct 2009 15:50:19 +0000 (17:50 +0200)]
trivial whitespace cleanups

10 years agoAdd docu of struct asf_header_info.
Andre Noll [Sat, 17 Oct 2009 15:08:38 +0000 (17:08 +0200)]
Add docu of struct asf_header_info.

10 years agowhitespace cleanups.
Andre Noll [Sat, 17 Oct 2009 10:50:33 +0000 (12:50 +0200)]
whitespace cleanups.

10 years agorename vector_fmul_add() vector_fmul_reverse_c() and make them static.
Andre Noll [Sat, 17 Oct 2009 10:48:15 +0000 (12:48 +0200)]
rename vector_fmul_add() vector_fmul_reverse_c() and make them static.

10 years agoremove src3 parameter from vector_fmul_add().
Andre Noll [Sat, 17 Oct 2009 10:40:34 +0000 (12:40 +0200)]
remove src3 parameter from vector_fmul_add().

10 years agoremove step parameter from vector_fmul_add().
Andre Noll [Sat, 17 Oct 2009 10:36:17 +0000 (12:36 +0200)]
remove step parameter from vector_fmul_add().

10 years agouse free() instead of pointless freep() in imdct_end().
Andre Noll [Fri, 16 Oct 2009 20:22:34 +0000 (22:22 +0200)]
use free() instead of pointless freep() in imdct_end().

10 years agoopen code fft_end().
Andre Noll [Fri, 16 Oct 2009 20:10:09 +0000 (22:10 +0200)]
open code fft_end().

10 years agoremove unused exptab field of struct fft_complex.
Andre Noll [Fri, 16 Oct 2009 20:03:12 +0000 (22:03 +0200)]
remove unused exptab field of struct fft_complex.

10 years agowe always compute the inverse mdct, so get rid of the inverse bit.
Andre Noll [Fri, 16 Oct 2009 20:02:01 +0000 (22:02 +0200)]
we always compute the inverse mdct, so get rid of the inverse bit.

10 years agosimplify definition of sqrthalf and capitalize it.
Andre Noll [Fri, 16 Oct 2009 19:46:13 +0000 (21:46 +0200)]
simplify definition of sqrthalf and capitalize it.

10 years agomove sine window stuff from imdct.c to wmadec_filter.c.
Andre Noll [Fri, 16 Oct 2009 19:17:20 +0000 (21:17 +0200)]
move sine window stuff from imdct.c to wmadec_filter.c.

10 years agoremove unused field tmp_buf of struct fft_context.
Andre Noll [Thu, 15 Oct 2009 20:13:07 +0000 (22:13 +0200)]
remove unused field tmp_buf of struct fft_context.

10 years agoremove unused exptab1 of struct fft_context.
Andre Noll [Thu, 15 Oct 2009 20:02:22 +0000 (22:02 +0200)]
remove unused exptab1 of struct fft_context.

10 years agoremove duplicate math.h include
Andre Noll [Thu, 15 Oct 2009 19:50:41 +0000 (21:50 +0200)]
remove duplicate math.h include

10 years agotrivial whitespace cleanups
Andre Noll [Wed, 14 Oct 2009 19:35:52 +0000 (21:35 +0200)]
trivial whitespace cleanups

10 years agoremove unused block_num field of struct private_wmadec_data.
Andre Noll [Wed, 14 Oct 2009 19:28:47 +0000 (21:28 +0200)]
remove unused block_num field of struct private_wmadec_data.

10 years agosimplify fft_init() due to split_radix is always 1.
Andre Noll [Wed, 14 Oct 2009 19:17:28 +0000 (21:17 +0200)]
simplify fft_init() due to split_radix is always 1.

10 years agotrivial mdct cleanups
Andre Noll [Wed, 14 Oct 2009 19:10:27 +0000 (21:10 +0200)]
trivial mdct cleanups

10 years agowma: Remove an unused variable.
Andre Noll [Mon, 12 Oct 2009 18:37:01 +0000 (20:37 +0200)]
wma: Remove an unused variable.

10 years agowma afh chunk time fixes
Andre Noll [Sat, 10 Oct 2009 12:42:51 +0000 (14:42 +0200)]
wma afh chunk time fixes

10 years agowma: Fix chunk_table computation.
Andre Noll [Fri, 9 Oct 2009 14:02:51 +0000 (16:02 +0200)]
wma: Fix chunk_table computation.

10 years agoMore misc wma fixes.
Andre Noll [Wed, 7 Oct 2009 23:09:52 +0000 (01:09 +0200)]
More misc wma fixes.

10 years agoRename mdcdt.c and mdcdt.h.
Andre Noll [Wed, 7 Oct 2009 21:25:27 +0000 (23:25 +0200)]
Rename mdcdt.c and mdcdt.h.

libvorbis also has an mdct_init(), but our own one gets used. This
makes the oggdec filter behave real funny.

This patch makes the oggdec filter work again.

10 years agoVarious wma fixes.
Andre Noll [Wed, 7 Oct 2009 18:53:47 +0000 (20:53 +0200)]
Various wma fixes.

10 years agoAdd a few more people to CREDITS.
Andre Noll [Tue, 6 Oct 2009 21:33:27 +0000 (23:33 +0200)]
Add a few more people to CREDITS.

10 years agoSet channels and samplerate of the filter chain
Andre Noll [Tue, 6 Oct 2009 21:25:23 +0000 (23:25 +0200)]
Set channels and samplerate of the filter chain

10 years agoFirst draft of the wma decoder.
Andre Noll [Tue, 6 Oct 2009 21:03:11 +0000 (23:03 +0200)]
First draft of the wma decoder.

Understands only v1, but is easy to crash.

10 years agoMerge branch 'master' into next
Andre Noll [Wed, 18 Nov 2009 18:28:28 +0000 (19:28 +0100)]
Merge branch 'master' into next

10 years agoMerge branch 'maint'
Andre Noll [Wed, 18 Nov 2009 18:24:28 +0000 (19:24 +0100)]
Merge branch 'maint'

10 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.

10 years agoMerge branch 'master' into next
Andre Noll [Thu, 12 Nov 2009 23:48:33 +0000 (00:48 +0100)]
Merge branch 'master' into next

10 years agoMerge branch 'maint'
Andre Noll [Thu, 12 Nov 2009 23:48:19 +0000 (00:48 +0100)]
Merge branch 'maint'

10 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.

10 years agoMerge branch 'master' into next
Andre Noll [Thu, 12 Nov 2009 21:12:46 +0000 (22:12 +0100)]
Merge branch 'master' into next

10 years agonew codename, reset version to git
Andre Noll [Tue, 10 Nov 2009 17:22:58 +0000 (18:22 +0100)]
new codename, reset version to git

10 years agothe paraslash-0.4.0 release tarball
Andre Noll [Tue, 10 Nov 2009 16:51:56 +0000 (17:51 +0100)]
the paraslash-0.4.0 release tarball

10 years agoparaslash 0.4.0 v0.4.0
Andre Noll [Tue, 10 Nov 2009 16:44:00 +0000 (17:44 +0100)]
paraslash 0.4.0

10 years agoMerge commit 'meins/next' into next
Andre Noll [Mon, 9 Nov 2009 17:31:34 +0000 (18:31 +0100)]
Merge commit 'meins/next' into next

10 years agoMerge branch 'master' into next
Andre Noll [Mon, 9 Nov 2009 17:31:25 +0000 (18:31 +0100)]
Merge branch 'master' into next

10 years agoMerge commit 'meins/master'
Andre Noll [Mon, 9 Nov 2009 17:31:09 +0000 (18:31 +0100)]
Merge commit 'meins/master'

10 years agoMerge branch 'maint'
Andre Noll [Mon, 9 Nov 2009 17:31:01 +0000 (18:31 +0100)]
Merge branch 'maint'

10 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

10 years agoMerge branch 'master' into next
Andre Noll [Sat, 7 Nov 2009 13:37:54 +0000 (14:37 +0100)]
Merge branch 'master' into next

10 years agoMerge branch 'maint'
Andre Noll [Sat, 7 Nov 2009 13:07:43 +0000 (14:07 +0100)]
Merge branch 'maint'

10 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.

10 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.

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

10 years agoMerge branch 'master' into next
Andre Noll [Fri, 6 Nov 2009 14:25:35 +0000 (15:25 +0100)]
Merge branch 'master' into next

10 years agoMerge branch 'maint'
Andre Noll [Fri, 6 Nov 2009 14:22:10 +0000 (15:22 +0100)]
Merge branch 'maint'

10 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

10 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.

10 years agoMerge branch 'master' into next
Andre Noll [Thu, 5 Nov 2009 23:28:05 +0000 (00:28 +0100)]
Merge branch 'master' into next

10 years agoMerge branch 'maint'
Andre Noll [Thu, 5 Nov 2009 23:27:40 +0000 (00:27 +0100)]
Merge branch 'maint'

Conflicts:
server.c

10 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.

10 years agoMerge branch 'master' into next
Andre Noll [Thu, 5 Nov 2009 21:49:33 +0000 (22:49 +0100)]
Merge branch 'master' into next

10 years agoMerge branch 'maint'
Andre Noll [Thu, 5 Nov 2009 21:43:03 +0000 (22:43 +0100)]
Merge branch 'maint'

10 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.

10 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.

10 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.

10 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

10 years agoMerge branch 'master' into next
Andre Noll [Sat, 24 Oct 2009 19:24:56 +0000 (21:24 +0200)]
Merge branch 'master' into next

10 years agoMerge branch 'maint'
Andre Noll [Sat, 24 Oct 2009 19:24:33 +0000 (21:24 +0200)]
Merge branch 'maint'

10 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.

10 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

10 years agoMerge branch 'maint' into next
Andre Noll [Thu, 22 Oct 2009 20:51:20 +0000 (22:51 +0200)]
Merge branch 'maint' into next

10 years agoMerge branch 'maint'
Andre Noll [Thu, 22 Oct 2009 20:51:09 +0000 (22:51 +0200)]
Merge branch 'maint'

10 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.

10 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.

10 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.

10 years agoMerge branch 'maint'
Andre Noll [Thu, 22 Oct 2009 17:24:44 +0000 (19:24 +0200)]
Merge branch 'maint'

10 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.

10 years agoMerge branch 'maint'
Andre Noll [Fri, 16 Oct 2009 13:36:15 +0000 (15:36 +0200)]
Merge branch 'maint'

10 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.

10 years agoFix compilation on MacOS.
Andre Noll [Fri, 16 Oct 2009 13:34:19 +0000 (15:34 +0200)]
Fix compilation on MacOS.

osx_write.c needs to include regex.h.

10 years agoMakefile.in: Introduce quiet mode and use it by default.
Andre Noll [Wed, 7 Oct 2009 01:15:56 +0000 (03:15 +0200)]
Makefile.in: Introduce quiet mode and use it by default.

Verbose mode can be chosen via "make V=1".

10 years agoMerge branch 'maint'
Andre Noll [Tue, 6 Oct 2009 21:16:27 +0000 (23:16 +0200)]
Merge branch 'maint'

10 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.

10 years agoAdd GIT-VERSION-FILE to .gitignore.
Andre Noll [Tue, 6 Oct 2009 21:13:52 +0000 (23:13 +0200)]
Add GIT-VERSION-FILE to .gitignore.