paraslash.git
6 years agoogg: Abstract out custom header code.
Andre Noll [Mon, 17 Jul 2017 23:02:50 +0000 (01:02 +0200)]
ogg: Abstract out custom header code.

The ogg/vorbis audio format handler employs the callback mechanism of
oac_get_file_info() to replace the metadata packet of an ogg/vorbis
stream by a fixed sized dummy packet. The same approach should also be
used for the ogg/opus audio format handler because ogg/opus metadata
can be arbitrary large too.

As a preparation for modifying the ogg/opus audio format
handler to skip the metadata header in this way, this commit
makes the infrastructure available to all audio format handlers
which employ the ogg container format by providing a public
interface in ogg_afh_common.c. The central data structure is struct
oac_custom_header, which replaces the former vorbis_get_header_data
structure. The layout of the new structure is only known to
ogg_afh_common.c. Users of this API need to call the accessor functions
declared in ogg_afh_common.h.

Only the ogg/vorbis audio format handler is converted to the new API.
A subsequent patch will make the ogg/opus audio format handler the
second user.

6 years agoPrefix public functions of ogg_afh_common.c with "oac".
Andre Noll [Mon, 17 Jul 2017 21:39:14 +0000 (23:39 +0200)]
Prefix public functions of ogg_afh_common.c with "oac".

This way it is clear that these are not functions provided by libogg.
Pure rename. no real changes.

6 years agoafh_recv: Downgrade severity of log message.
Andre Noll [Mon, 17 Jul 2017 21:06:42 +0000 (23:06 +0200)]
afh_recv: Downgrade severity of log message.

Currently we print one line per chunk, which can get very noisy. So
"debug" is the right loglevel to use here.

6 years agoMerge branch 'refs/heads/t/doxygen'
Andre Noll [Fri, 21 Jul 2017 17:45:31 +0000 (19:45 +0200)]
Merge branch 'refs/heads/t/doxygen'

This series contains an update of Doxyfile to a newer doxygen version
and an overhaul of the source code documentation. Several stale
references have been fixed. Other parts of the documentation have
been improved.

Cooking for almost a month.

* refs/heads/t/doxygen:
  aft.c: Trivial spelling/whitespace fixes.
  afh: Expand documentation of init function declarations.
  filter: Remove duplicate documentation of filter_get().
  doxygen: Improve documentation of struct receiver.
  doxygen: Add \ref to references.
  Improve documentation of mm.c and mm.h.
  doxygen: Don't refer to Black Hats Manual.
  doxygen: Don't refer to libosl functions.
  doxygen: Trivial cleanups.
  doxygen: Remove some stale doxygen references.
  recv: Explain user data mechanism.
  Update to doxygen-1.8.11.

The merge resulted in a few conflicts which were easy to resolve.

6 years agoafh: Unify name of init functions.
Andre Noll [Fri, 14 Jul 2017 18:05:21 +0000 (20:05 +0200)]
afh: Unify name of init functions.

The init functions of the mp3 and ogg audio format handlers lacked
the _afh part in the name which all other audio format handlers have.

6 years agoafh: Fix typo in comment.
Andre Noll [Fri, 14 Jul 2017 18:45:57 +0000 (20:45 +0200)]
afh: Fix typo in comment.

6 years agoaft.c: Improve documentation of get_afhi_of_row().
Andre Noll [Tue, 11 Jul 2017 17:33:31 +0000 (19:33 +0200)]
aft.c: Improve documentation of get_afhi_of_row().

It is not obvious that the function initializes the afh_info structure
so that its members point to memory-mapped data. This comment adds
some clarifying comments.

6 years agomood.c: Rename compute_mood_score().
Andre Noll [Thu, 6 Jul 2017 18:46:29 +0000 (20:46 +0200)]
mood.c: Rename compute_mood_score().

The main purpose of this function is to determine whether the
audio file is admissible with respect to the given mood. So
row_is_admissible() is more to the point.

6 years agomood.c: Trivial whitespace fixes.
Andre Noll [Thu, 6 Jul 2017 19:52:45 +0000 (21:52 +0200)]
mood.c: Trivial whitespace fixes.

6 years agoRemove some unnecessary includes.
Andre Noll [Sun, 9 Jul 2017 18:20:05 +0000 (20:20 +0200)]
Remove some unnecessary includes.

These headers are already included with para.h.

6 years agogui: Trivial whitespace and spelling fixes.
Andre Noll [Sat, 15 Jul 2017 12:01:28 +0000 (14:01 +0200)]
gui: Trivial whitespace and spelling fixes.

Nothing interesting in this patch..

6 years agoaft: Fix a typo in comment.
Andre Noll [Sun, 16 Jul 2017 00:21:59 +0000 (02:21 +0200)]
aft: Fix a typo in comment.

6 years agoafs: Improve documentation of callback_result_handler.
Andre Noll [Sun, 16 Jul 2017 00:07:48 +0000 (02:07 +0200)]
afs: Improve documentation of callback_result_handler.

The old text was rather incomprehensive ("chunks to data").

6 years agobuild: Remove an unused function from configure.ac.
Andre Noll [Fri, 14 Jul 2017 13:55:28 +0000 (15:55 +0200)]
build: Remove an unused function from configure.ac.

This function has become unused with the removal of gengetopt, but
we missed to drop it back then.

6 years agobuild: Fix typo in comment to HAVE_IP_MREQN.
Andre Noll [Sat, 8 Jul 2017 23:15:41 +0000 (01:15 +0200)]
build: Fix typo in comment to HAVE_IP_MREQN.

Introduced in 2009 when the --udp_mcast_iface option was implemented
and the check for struct ip_mreqn was added.

6 years agomanual: Add a sentence about release notifications.
Andre Noll [Sat, 15 Jul 2017 13:37:43 +0000 (15:37 +0200)]
manual: Add a sentence about release notifications.

This patch was meant to be applied years ago, but it got stashed
and then forgotten.

6 years agomanual: Fix typo.
Andre Noll [Sat, 15 Jul 2017 13:33:47 +0000 (15:33 +0200)]
manual: Fix typo.

Duplicate "about".

6 years agomanual: libosl is optional.
Andre Noll [Fri, 14 Jul 2017 13:39:28 +0000 (15:39 +0200)]
manual: libosl is optional.

Even without libosl, the build succeeds (only para_server won't be
built). Hence libosl should be listed as optional software. This
commit moves the item out of the list of mandatory packages.

6 years agobuild: Fix check for lopsub.
Andre Noll [Sat, 8 Jul 2017 16:36:03 +0000 (18:36 +0200)]
build: Fix check for lopsub.

If the lopsub library is not installed, HAVE_LOPSUB should be set to
"no".  The current code in configure.ac gets this wrong, causing the
configure script to succeed even if the library is not installed.

6 years agoMerge branch 'refs/heads/t/manual'
Andre Noll [Fri, 14 Jul 2017 12:50:43 +0000 (14:50 +0200)]
Merge branch 'refs/heads/t/manual'

A couple of patches which merge the contents of the overview.pdf file
into the user manual. After this, the documentation no longer depends
on dia.

Cooking for six weeks.

* refs/heads/t/manual:
  manual: Expand description of para_play.
  manual: Omit level 3 headers from table of contents.
  manual: Combine overview.pdf and the user manual.
  manual: Remove text about permissions of /var/paraslash.
  manual: Correct format of para_client help output.
  manual: Add lopsub installation instructions to quick start.

6 years agoMerge branch 'maint'
Andre Noll [Thu, 13 Jul 2017 15:21:13 +0000 (17:21 +0200)]
Merge branch 'maint'

A single important fix for the error subsystem. The merge conflicted
because master removed the E_AAC_AFH_INIT error code while maint
still has it. The conflict was trivial to resolve.

* refs/heads/maint:
  Let error codes start out at index 1.

6 years agoLet error codes start out at index 1.
Andre Noll [Sat, 8 Jul 2017 20:55:11 +0000 (22:55 +0200)]
Let error codes start out at index 1.

When the error code facility was simplified one year ago in commit
a775408 (Simplify the error subsystem, get rid of error2.[ch]) we
introduced a simple enum for all error codes, but missed the fact
that this approach assigns the first error code the value zero.

Hence, when the AAC decoder returns this error code, it will not be
recognized as an error because we generally check for negative return
values only.

This patch introduces an unused dummy error code so that the real
error codes start at index 1.

6 years agoMerge branch 'refs/heads/t/para_play'
Andre Noll [Sun, 9 Jul 2017 17:38:40 +0000 (19:38 +0200)]
Merge branch 'refs/heads/t/para_play'

A single patch which removes pointless play_task arguments to many
functions in play.c.

Cooking for well over a month.

* refs/heads/t/para_play:
  play: Remove pointless play_task arguments.

6 years agoaft.c: Trivial spelling/whitespace fixes.
Andre Noll [Tue, 13 Jun 2017 22:03:45 +0000 (00:03 +0200)]
aft.c: Trivial spelling/whitespace fixes.

Avoid an overlong line, spell out memory-mapped and don't misspell
"formatted".

6 years agoafh: Expand documentation of init function declarations.
Andre Noll [Tue, 13 Jun 2017 21:21:34 +0000 (23:21 +0200)]
afh: Expand documentation of init function declarations.

It's not obvious why all of these are declared here, so explain this
in a bit more detail.

6 years agofilter: Remove duplicate documentation of filter_get().
Andre Noll [Tue, 13 Jun 2017 19:48:18 +0000 (21:48 +0200)]
filter: Remove duplicate documentation of filter_get().

This public function is documented both in filter.h and in
filter_common.c. Get rid of the comment in the header file as this
is incomplete and causes a doxygen warning.

6 years agodoxygen: Improve documentation of struct receiver.
Andre Noll [Tue, 30 May 2017 19:11:09 +0000 (21:11 +0200)]
doxygen: Improve documentation of struct receiver.

The documentation still referred to the former gengetopt related
->conf pointer and also had some language and punctuation issues. The
new text should fix this, and is more to the point.

6 years agodoxygen: Add \ref to references.
Andre Noll [Thu, 18 May 2017 18:58:42 +0000 (20:58 +0200)]
doxygen: Add \ref to references.

This way doxygen issues a warning if the file/function/structure no
longer exists and a stale reference remains.

6 years agoImprove documentation of mm.c and mm.h.
Andre Noll [Sun, 21 May 2017 19:44:45 +0000 (21:44 +0200)]
Improve documentation of mm.c and mm.h.

This was in a rather bad shape and referred to functions like
mood_open() which have been renamed long ago.

6 years agodoxygen: Don't refer to Black Hats Manual.
Andre Noll [Fri, 19 May 2017 07:24:28 +0000 (09:24 +0200)]
doxygen: Don't refer to Black Hats Manual.

It's no longer online.

6 years agodoxygen: Don't refer to libosl functions.
Andre Noll [Fri, 19 May 2017 07:00:35 +0000 (09:00 +0200)]
doxygen: Don't refer to libosl functions.

They are not part of the tree, and there is no dedicated man page
for them.

6 years agodoxygen: Trivial cleanups.
Andre Noll [Fri, 19 May 2017 06:22:15 +0000 (08:22 +0200)]
doxygen: Trivial cleanups.

A couple of capitalization and punctuation fixes.

6 years agodoxygen: Remove some stale doxygen references.
Andre Noll [Tue, 16 May 2017 21:09:33 +0000 (23:09 +0200)]
doxygen: Remove some stale doxygen references.

When we switched to lopsub, the callback request functions became
unused and were removed. At the same time, all command handlers were
made static, so they are no longer part of the doxygen documentation
and we shouldn't refer to them any more.

Also struct slot_info and the server_uptime variable have been made
private to their respective files audiod and time.c. Tthe latter was
in fact replaced by a timeval struct long ago.

The http and udp receivers don't have an init function any more, and
get_chunk_table_of_row() was removed ten years ago in commit 54a480ae.

Most references of the source code documentation will be annotated
with \ref in a subsequent commit to avoid this kind of documentation
bug in the future.

6 years agorecv: Explain user data mechanism.
Andre Noll [Tue, 16 May 2017 21:16:44 +0000 (23:16 +0200)]
recv: Explain user data mechanism.

This is not obvious, so it deserves a comment in recv_init(). The
patch also adds a reference to each of the four instances of struct
receiver, reducing the number of doxygen warnings when EXTRACT_ALL
is set to NO in Doxyfile.

6 years agoUpdate to doxygen-1.8.11.
Andre Noll [Wed, 17 May 2017 21:20:12 +0000 (23:20 +0200)]
Update to doxygen-1.8.11.

This is the result of running doxygen -u.

6 years agoplay: Remove unused dummy completer.
Andre Noll [Tue, 13 Jun 2017 18:22:08 +0000 (20:22 +0200)]
play: Remove unused dummy completer.

There is no stop command for para_play.

6 years agonet.c: Silence clang warning.
Andre Noll [Sun, 11 Jun 2017 10:13:22 +0000 (12:13 +0200)]
net.c: Silence clang warning.

clang-3.8.0 on FreeBSD complains about a recent change to net.c:

net.c:606:33: warning: missing field 'ss_family' initializer [-Wmissing-field-initializers]
struct sockaddr_storage ss = {0};
       ^
This line was introduced in commit 63128eea (net: Always initialize
struct sockaddr_storage) to avoid a warning from the static analyzer
of clang. Setting .ss_family initializes all struct members, which
makes both the analyzer and the compiler happy again.

6 years agofilter: Handle bad filter numbers gracefully.
Andre Noll [Tue, 13 Jun 2017 20:33:26 +0000 (22:33 +0200)]
filter: Handle bad filter numbers gracefully.

This modifies filter_get() to return NULL if an invalid filter number
is given, rather than aborting the process. This way applications
can loop over all filters without having to include filter_cmd.lsg.h.

filter_name(), which also receives a filter number, has no such
sanity check and could possibly access uninitialized memory if an
invalid argument was passed. This commit adds the check and makes the
function return NULL in this case, just like filter_get(). Moreover,
the function lacked documentation, so let's add it now.

6 years agoaudiod: Fix off-by-one bug in init_default_filters().
Andre Noll [Tue, 13 Jun 2017 20:09:01 +0000 (22:09 +0200)]
audiod: Fix off-by-one bug in init_default_filters().

Filter numbers are one-based because zero is the number of the
(non-existing) supercommand of the filter_cmd suite. The loop in
init_default_filters() gets this wrong.

This bites only if no filter is given for at least one audio format.
Fortunately, the bug was easy to find because it triggers an assertion
in filter_get() which checks that the given number is at least one.

6 years agoRemove osx_write.c, this time for real.
Andre Noll [Sun, 21 May 2017 21:12:48 +0000 (23:12 +0200)]
Remove osx_write.c, this time for real.

This file was removed prior to v0.6.0 in commit 3af6411b (Drop support
for Mac OS), but it was brought back by mistake via the lopsub merge
764e71ce.

6 years agoserver: Fix help text of ls -s=p.
Andre Noll [Wed, 31 May 2017 06:57:32 +0000 (08:57 +0200)]
server: Fix help text of ls -s=p.

This text still referred to -p, which has been superseeded by -b.

6 years agoafh: Make parse result pointer static.
Andre Noll [Tue, 16 May 2017 20:48:02 +0000 (22:48 +0200)]
afh: Make parse result pointer static.

It is only referenced within afh.c.

6 years agoDoxyfile: Simplify exclude patterns.
Andre Noll [Tue, 16 May 2017 20:21:47 +0000 (22:21 +0200)]
Doxyfile: Simplify exclude patterns.

The patterns which are removed in this commit are a leftover from
the pre-lopsub era and match no files in the source tree.

6 years agorecv_common.c: Fix doxygen warning in recv_init().
Andre Noll [Tue, 16 May 2017 20:21:12 +0000 (22:21 +0200)]
recv_common.c: Fix doxygen warning in recv_init().

In the doxygen comment of this function, one argument name was prefixed
with a backslash by mistake. Old doxygen versions did not complain
about this, but doxygen-1.8.11 does:

warning: unexpected token in comment block while parsing the argument of command param

6 years agoplay: Remove pointless play_task arguments.
Andre Noll [Sat, 29 Apr 2017 14:08:13 +0000 (16:08 +0200)]
play: Remove pointless play_task arguments.

The play task is a global variable anyway, so it's pointless to pass
it to almost every function.

6 years agomanual: Expand description of para_play.
Andre Noll [Mon, 1 May 2017 16:28:52 +0000 (18:28 +0200)]
manual: Expand description of para_play.

The text did not contain any characteristic features. Let's at least
mention that all audio formats are supported and that the command
line interface was designed to not suck.

6 years agomanual: Omit level 3 headers from table of contents.
Andre Noll [Sat, 29 Apr 2017 19:51:49 +0000 (21:51 +0200)]
manual: Omit level 3 headers from table of contents.

The table of contents was rather large because it contained too much
detail. This commit converts all level 3 headings to inline html which
has no visible effect except that the headings no longer appear in
the table of contents.

6 years agomanual: Combine overview.pdf and the user manual.
Andre Noll [Sat, 29 Apr 2017 02:33:17 +0000 (04:33 +0200)]
manual: Combine overview.pdf and the user manual.

The figures of the overview.pdf file look rather odd although they
used to look better when they were created four years ago. Apparently,
the dia command line tool which creates the pdf from the .dia source
file has changed and now messes up the lines which connect the parts
of the figure.

This commit re-implements four out of the five figures of the overview
file as ascii art in manual.md, removes overview.dia, and modifies
the documentation web page to no longer refer to the dia version.

The text of the overview file has been merged with the manual and
got improved a bit.

dia sucks.

6 years agomanual: Remove text about permissions of /var/paraslash.
Andre Noll [Sat, 29 Apr 2017 20:09:21 +0000 (22:09 +0200)]
manual: Remove text about permissions of /var/paraslash.

paraslash-0.6.x uses the abstract socket namespace by default, so
this should no longer be an issue.

6 years agomanual: Correct format of para_client help output.
Andre Noll [Sat, 29 Apr 2017 15:21:26 +0000 (17:21 +0200)]
manual: Correct format of para_client help output.

The permissions are actually listed in the *second* column, but the
number of the column does not really matter, so don't mention it
at all.

6 years agomanual: Add lopsub installation instructions to quick start.
Andre Noll [Sat, 29 Apr 2017 02:55:53 +0000 (04:55 +0200)]
manual: Add lopsub installation instructions to quick start.

paraslash-0.6.x depends on lopsub, so we should list the commands to
install this library at the beginning of the quick start section.

6 years agodoxygen: Avoid segfault.
Andre Noll [Tue, 16 May 2017 20:08:19 +0000 (22:08 +0200)]
doxygen: Avoid segfault.

After an upgrade to Ubuntu-16.04, the new doxygen version 1.8.11
started to segfault. It turned out that this can be circumvented
by disabling USE_HTAGS so that doxygen will use its built-in source
browser instead of the htags tool of GNU global.

However, the html which is generated by the built-in source browser
the source code is unreadable because leading tab characters are not
shown, so indentation is messed up.

This patch deactivates the source browser for now, getting rid of
all source code in the generated output.

6 years agoclient: Silence a gcc-7.1,0 warning.
Andre Noll [Sat, 6 May 2017 15:40:38 +0000 (17:40 +0200)]
client: Silence a gcc-7.1,0 warning.

This version of gcc complains because a case statement in
client_pre_select() may fall through. The fallthrough is intentional,
however, and this is annotated with a comment. gcc-7 scans the comments
in a switch statement and suppresses the warning if it recognizes
a comment which says that fallthrough is intended. But for this to
happen, we must spell it correctly, and without whitespace.

After this commit, gcc-7 compiles the tree with no warnings.

6 years agomp4ff: Fix typo in error code.
Andre Noll [Tue, 2 May 2017 18:49:08 +0000 (20:49 +0200)]
mp4ff: Fix typo in error code.

6 years agoRemove unused error code MPI_PRINT.
Andre Noll [Sat, 29 Apr 2017 14:54:03 +0000 (16:54 +0200)]
Remove unused error code MPI_PRINT.

This had been removed already in commit eab41e87 (gcrypt: Remove
open-coded OAEP padding) but it was brought back by mistake in commit
9264932e (Merge branch 'refs/heads/t/dynamic_chunks').

6 years agoparaslash 0.6.0 v0.6.0
Andre Noll [Fri, 28 Apr 2017 15:36:05 +0000 (17:36 +0200)]
paraslash 0.6.0

6 years agoMerge branch 'refs/heads/t/logo-0.6'
Andre Noll [Fri, 28 Apr 2017 13:47:39 +0000 (15:47 +0200)]
Merge branch 'refs/heads/t/logo-0.6'

The new logo in .png and .ico format.

Cooking for three weeks.

* refs/heads/t/logo-0.6:
  Reduce size of paraslash.ico.
  The new logo for v0.6.x.

6 years agoMerge branch 'refs/heads/t/lopsub'
Andre Noll [Thu, 27 Apr 2017 18:39:32 +0000 (20:39 +0200)]
Merge branch 'refs/heads/t/lopsub'

The bulk of the changes in this release is the conversion of all
command line parsers from gengetopt to lopsub.

The series also contains a few cleanups that have become possible
due to the switch from gengetopt to lopsub.

The patches towards the end of the series rename para_fade to
para_mixer.

Naturally, the merge conflicted rather heavily against the other
topic branches that have been merged since the lopsub branch was
started. Conflicting files:

Makefile.real afh.c afh_recv.c configure.ac osx_write.c write.c

The resolutions for these conflicts were recorded with git rerere
and have been tested for quite some time.

Cooking for three weeks.

* refs/heads/t/lopsub: (74 commits)
  audioc: Avoid double free in audioc_i9e_line_handler().
  audiod: Avoid uninitialized memory access.
  Simplify mixer setup.
  mixer: Implement non-linear time scale for fading.
  mixer: Allow arbitrary relative time for sleep subcommand.
  Convert para_fade to subcommands, rename it to para_mixer.
  build: Create .dep files only during compilation.
  build: Simplify definition of $m4_lls_deps.
  build: Rename command list variables.
  build: Combine $(CFLAGS) and $(STRICT_CFLAGS).
  build: Let .d files depend only on .c.
  build: Don't create phony targets for dependencies.
  build: Remove duplicate dependency.
  build: Remove cmdline_dir and friends.
  build: Remove some unused variables from Makefile.real.
  build: Remove m4/gengetopt.
  Remove gengetopt and help2man checks from configure.ac.
  Remove man_util.bash.
  Remove ggo.c and ggo.h.
  manual: Do not mention gengetopt and help2man any more.
  ...

6 years agovss: Add an assertion for vsst->header_buf.
Andre Noll [Fri, 21 Apr 2017 18:30:12 +0000 (20:30 +0200)]
vss: Add an assertion for vsst->header_buf.

if vsst->header_len > 0 but vsst->header_buf is NULL, something weird
is going on and non-obvious bad things will happen later. The assertion
makes sure we notice early that there is a problem. It also silences a
scan-build warning.

6 years agowma_afh: Remove some dead stores.
Andre Noll [Fri, 21 Apr 2017 18:13:14 +0000 (20:13 +0200)]
wma_afh: Remove some dead stores.

scan-build complains with

Value stored to 'orig_title_bytes' is never read

and similar for orig_artist_bytes and orig_comment_bytes. Indeed,
these variables are only referenced in the if clause but not in the
else clause.

This commit makes them local to the if clause and removes the dead
stores in the else clause..

6 years agoMerge branch 'maint'
Andre Noll [Tue, 25 Apr 2017 16:04:57 +0000 (18:04 +0200)]
Merge branch 'maint'

A couple of fixes found by the clang static analyzer.

* maint:
  aft: Check return value of load_afsi().
  audiod: Avoid reading garbage in get_time_string().
  net: Always initialize struct sockaddr_storage.
  wma_afh: Fix two bugs in convert_utf8_to_utf16().

6 years agoMerge branch 'refs/heads/t/xz'
Andre Noll [Mon, 24 Apr 2017 18:05:18 +0000 (20:05 +0200)]
Merge branch 'refs/heads/t/xz'

A single patch which modifies the build system to create xz-compressed
tarballs. The patch conflicted against the changes introduced by the
recently merged makefile_conventions topic branch.

Cooking for almost a month.

* refs/heads/t/xz:
  Switch to xz to compress tarballs.

6 years agoReduce size of paraslash.ico.
Andre Noll [Mon, 24 Apr 2017 02:03:06 +0000 (04:03 +0200)]
Reduce size of paraslash.ico.

The image geometry of a favicon needs to be only 32x32. Scaling the
image down to this geometry reduced the file size from 73K to 4K.

6 years agoMerge branch 'refs/heads/t/dynamic_chunks'
Andre Noll [Sun, 23 Apr 2017 19:12:22 +0000 (21:12 +0200)]
Merge branch 'refs/heads/t/dynamic_chunks'

A rather long and intrusive series that finally improves the aac
decoder and audio format handler.

The merge had a minor conflict in error.h, which was easily resolved
by removing both affected error codes.

Cooking for a month.

* refs/heads/t/dynamic_chunks: (24 commits)
  afh_recv: Check return value of afh_get_chunk().
  aacdec: Decode only one frame per iteration.
  aacdec: Combine aac_open() and aacdec_open().
  aacdec: Make "initialized" a boolean.
  aacdec: Make frame_info local to ->post_select().
  aacdec: Remove pointless assignment.
  aacdec: Remove pointless check and improve comment.
  aacdec: Rename buffer variables.
  aacdec: Remove pointless variable p.
  aacdec: Remove check which is always true.
  aacdec: Kill pointless label.
  aacdec: Remove superfluous assignment.
  aacdec: Improve and silence error message.
  aacdec: Prefer NeAACDecInit() over NeAACDecInit2().
  aacdec: Don't eat full buffer on errors.
  Combine aacdec and aac_common.
  Convert the aac audio format handler to libmp4ff.
  aac_afh: Don't create chunk tables any more.
  afh: Dynamic chunks.
  server: Store max chunk size in database.
  ...

6 years agoafh_recv: Check return value of afh_get_chunk().
Andre Noll [Fri, 21 Apr 2017 18:57:38 +0000 (20:57 +0200)]
afh_recv: Check return value of afh_get_chunk().

Starting with commit b6b571e6c (afh: Dynamic chunks) the function
returns an int value and may fail. Although we store the return value
in a variable, the value of the variable is never read, causing the
clang static analyzer to complain (rightfully).

This patch modifies afh_recv_post_select() to fail if afh_get_chunk()
returns negative.

6 years agoaft: Check return value of load_afsi().
Andre Noll [Fri, 21 Apr 2017 20:54:36 +0000 (22:54 +0200)]
aft: Check return value of load_afsi().

This function should never fail, but it does return an error code and
all callers except copy_selector_info() check the return value. So
let's add the check there as well.

6 years agoaudiod: Avoid reading garbage in get_time_string().
Andre Noll [Fri, 21 Apr 2017 20:35:37 +0000 (22:35 +0200)]
audiod: Avoid reading garbage in get_time_string().

If no writer is active, wstime is not initialized. Yet we check
whether wstime.tv_sec == 0.

Introduce a helper variable to avoid reading garbage. This also
improves readability.

Found by the clang static analyzer.

6 years agonet: Always initialize struct sockaddr_storage.
Andre Noll [Fri, 21 Apr 2017 20:04:09 +0000 (22:04 +0200)]
net: Always initialize struct sockaddr_storage.

The static analyzer of clang claims that the left operand of the condition

ss->ss_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&ia6->sin6_addr);

in SS_IS_ADDR_V4MAPPED() is a garbage value. The code has been like
this for seven years without problems, so the warning is probably
bogus.

It does not hurt to initialize the sockaddr_storage structures though,
which silences the warning.

6 years agowma_afh: Fix two bugs in convert_utf8_to_utf16().
Andre Noll [Fri, 21 Apr 2017 19:49:20 +0000 (21:49 +0200)]
wma_afh: Fix two bugs in convert_utf8_to_utf16().

This function has two issues:

* If iconv_open() fails and src is NULL (or *src is NULL) we attempt
to close an invalid file descriptor.

* On errors, we free *dst but miss to set it to NULL, causing a double
free in the caller.

This patch addresses both issues. The double free was found by the
clang static analyzer.

6 years agoaudioc: Avoid double free in audioc_i9e_line_handler().
Andre Noll [Fri, 21 Apr 2017 19:22:34 +0000 (21:22 +0200)]
audioc: Avoid double free in audioc_i9e_line_handler().

If connect_audiod() returns negative, we free "args" twice. Found by
the clang static analyzer.

6 years agoaudiod: Avoid uninitialized memory access.
Andre Noll [Fri, 21 Apr 2017 18:43:06 +0000 (20:43 +0200)]
audiod: Avoid uninitialized memory access.

In handle_connect(), the local pointer variable errctx is not
initialized. If an error occurs early in the function, for example
because recv_cred_buffer() fails, we jump to the "out" label and try
to print the string errctx points to. This will cause a segfault or
worse, so make sure the variable is always initialized.

This bug was found by the static analyzer of clang.

6 years agoMerge branch 'refs/heads/t/wma_improvements'
Andre Noll [Fri, 21 Apr 2017 15:07:00 +0000 (17:07 +0200)]
Merge branch 'refs/heads/t/wma_improvements'

A couple of simple patches which simplify the WMA code and improve
readability.

Cooking for three weeks.

* refs/heads/t/wma_improvements:
  wmadec: Use read_u32_be().
  wma_afh.c: Remove condition which is always true.
  imdct.c: Replace pointless macro PASS.
  wma_common.c: Remove pointless assignment.
  wma_afh.c: Use DIV_ROUND_UP().

7 years agoMerge branch 'refs/heads/t/makefile_conventions'
Andre Noll [Wed, 19 Apr 2017 17:13:20 +0000 (19:13 +0200)]
Merge branch 'refs/heads/t/makefile_conventions'

A bunch of changes which strive to make the paraslash build system
more standard.

Cooking for three months.

* refs/heads/t/makefile_conventions:
  build: Add target "check" as a synonym for "test".
  build: Rename target "tarball" to "dist".
  build: Do not strip installed executables by default.
  build: Support $(DESTDIR).
  build: Rename clean targets.

7 years agoMerge branch 'refs/heads/t/rm_as_compat'
Andre Noll [Tue, 18 Apr 2017 12:55:03 +0000 (14:55 +0200)]
Merge branch 'refs/heads/t/rm_as_compat'

A single patch that removes socket compatibility code from para_audiod,
para_audioc and para_server.

Cooking for three months.

* refs/heads/t/rm_as_compat:
  Remove compatibility code for abstract unix domain sockets.

7 years agoMerge branch 'refs/heads/t/rm_rc4'
Andre Noll [Sun, 16 Apr 2017 18:15:35 +0000 (20:15 +0200)]
Merge branch 'refs/heads/t/rm_rc4'

This patch removes support for RC4, making the AES-based stream
cipher mandadory. The aes_ctr128 server feature is made a no-op,
breaking support with very old clients (<= 0.5.1).

Cooking for three months.

* refs/heads/t/rm_rc4:
  crypt: Remove RC4 support.

7 years agowww: Fix an html bug in download page.
Andre Noll [Sun, 16 Apr 2017 15:37:51 +0000 (17:37 +0200)]
www: Fix an html bug in download page.

Dillo complains with

HTML warning: line 45, Unexpected closing tag: </p> -- expected </ul>.

This complaint looks bogus, but removing the <p> and </p> tags makes the
warning go away with no visible change.

7 years agoMerge branch 'refs/heads/t/rm_oaep'
Andre Noll [Sat, 15 Apr 2017 13:51:38 +0000 (15:51 +0200)]
Merge branch 'refs/heads/t/rm_oaep'

The open-coded OAEP padding removed in this series is no longer needed
since all supported libgcrypt versions support OAEP padding.

The series also contains a few follow up cleanups for gcrypt.c.

Cooking for three months.

* refs/heads/t/rm_oaep:
  gcrypt: Simplify init_random_seed_or_die().
  gcrypt: Rename E_OEAP to E_RSA_DECODE.
  gcrypt: Remove open-coded OAEP padding.

7 years agoMerge branch 'refs/heads/t/rm_asn'
Andre Noll [Sun, 9 Apr 2017 11:47:15 +0000 (13:47 +0200)]
Merge branch 'refs/heads/t/rm_asn'

A few cleanups, and one patch which removes an obsolete feature,
getting rid of an open-coded ASN parser.

Cooking for three months.

* refs/heads/t/rm_asn:
  Remove unused E_PUBLIC_KEY.
  crypt.c: Combine load_key() and get_private_key().
  crypto: Remove support for ASN public keys.
  crypto: Simplify asymetric key handling.
  crypto: Rename check_key_file() -> check_private_key_file().
  gcrypt.c: Always initialize result pointer in get_private_key().

7 years agoMerge branch 'refs/heads/t/rm_osx'
Andre Noll [Tue, 4 Apr 2017 06:42:28 +0000 (08:42 +0200)]
Merge branch 'refs/heads/t/rm_osx'

Two simple patches which remove code and documentation related to
Mac OS. Cooking since 2017-01-04.

* refs/heads/t/rm_osx:
  build: Remove compatibility check for clock_gettime().
  Drop support for Mac OS.

7 years agoSimplify mixer setup.
Andre Noll [Fri, 30 Dec 2016 23:06:10 +0000 (00:06 +0100)]
Simplify mixer setup.

The ->init method of the two mixer implementations initialize the
members of the mixer structure. This structure contains only function
pointers. Their values, once set, never change.

Hence we may initialize the structure at compile time and make it
constant.

7 years agomixer: Implement non-linear time scale for fading.
Andre Noll [Fri, 30 Dec 2016 22:25:11 +0000 (23:25 +0100)]
mixer: Implement non-linear time scale for fading.

For some sound hardware, changing the volume channel has little
effect for small values but even an increment by one is audible for
high values. For such hardware it is desirable to scale the volume
in a non-linear way.

This patch implements this feature. The new --fade-exponent receives
an argument to control the level of non-linearity. The default value
of zero results in old behavior: linear scaling.

For the implementation we need to compute (the inverse of) t ->
t^alpha, where alpha is between zero and one. This requires the use
of exp(3) and log(3), so we need to include <math.h> and link with -lm.

7 years agoThe new logo for v0.6.x.
Andre Noll [Sun, 25 Dec 2016 20:28:26 +0000 (21:28 +0100)]
The new logo for v0.6.x.

7 years agoSwitch to xz to compress tarballs.
Andre Noll [Sun, 3 Jul 2016 14:47:13 +0000 (16:47 +0200)]
Switch to xz to compress tarballs.

xz compresses better than bzip2, and decompression needs less time. It
is also widely used by many other software projects, so there should
be no disadvantage.

We keep removing the .bz2 tarball on make clean, and also keep the
paraslash-*.tar.bz2 entry in .gitignore for the time being.

7 years agomixer: Allow arbitrary relative time for sleep subcommand.
Andre Noll [Tue, 27 Dec 2016 23:53:29 +0000 (00:53 +0100)]
mixer: Allow arbitrary relative time for sleep subcommand.

If --wake-hour is not given, the wake time defaults to now + nine
hours.  This is arbitrary, and the constant 9 was hardcoded with no
way to specify it at the command line or in the config file.

This commit replaces --wake-hour and --wake-min by --wake-time whose
argument must be given in HH:MM syntax. An optional leading '+'
character allows to specify a relative offset.

7 years agoConvert para_fade to subcommands, rename it to para_mixer.
Andre Noll [Tue, 27 Dec 2016 21:19:03 +0000 (22:19 +0100)]
Convert para_fade to subcommands, rename it to para_mixer.

para_fade operates in one of several modes, but the command line
options are shared. So most of the options are ignored for any
particular mode.  With lopsub we can do better and define one
subcommand per mode so that options which are only relevant to one
subcommand can be made local to that subcommand.

With subcommands the syntax of the command changes, which breaks
existing scripts. So it seems to be prudent to rename the executable
from para_fade to para_mixer. The old name was a bit misleading anyway
since the command can do much more than just fade the volume.

7 years agobuild: Create .dep files only during compilation.
Andre Noll [Sat, 21 Jan 2017 15:18:44 +0000 (16:18 +0100)]
build: Create .dep files only during compilation.

It is unnecessary to run a dedicated command to create the dependency
files because:

* If the object file does not exist, we have to run the compiler
anyway, which creates the dependency on the fly.

* If the object file exists, the dependency file also exists, so
the build system notices if the object file needs to be rebuilt,
for example because an included header file was modified.

The only thing we must guarantee is that all included header files
exist. We do this by introducing an order-only dependency: all object
files depend on all .lsg.h files but we impose this specific ordering
without forcing the targets to be updated.

This speeds up the build a lot and also simplifies Makefile.real.

7 years agobuild: Simplify definition of $m4_lls_deps.
Andre Noll [Sat, 21 Jan 2017 15:08:07 +0000 (16:08 +0100)]
build: Simplify definition of $m4_lls_deps.

7 years agobuild: Rename command list variables.
Andre Noll [Sun, 17 Jul 2016 18:54:00 +0000 (20:54 +0200)]
build: Rename command list variables.

The old names, xxx_command_lists and man_util_command_lists are not
accurate any more, and unnecessarily clumsy to boot.

This patch renames the variables to xxx_commands and all_commands and
sorts the three affected sections of the Makefile alphabetically to
reduce the risk of future merge conflicts.

7 years agobuild: Combine $(CFLAGS) and $(STRICT_CFLAGS).
Andre Noll [Sun, 17 Jul 2016 16:27:13 +0000 (18:27 +0200)]
build: Combine $(CFLAGS) and $(STRICT_CFLAGS).

We used to compile the parsers generated by gengetopt with less strict
flags to avoid warnings in generated files. With lopsub this is no
longer necessary, so one set of flags suffices.

Moreover, we currently initialize $(STRICT_CFLAGS) to $(CFLAGS) (from
the environment), then append our own flags. This is unfortunate
because the user defined settings in $(CFLAGS) are overwritten.

This patch changes the Makefile to only set STRICT_CFLAGS. We now
pass $(STRICT_CFLAGS) $(CFLAGS) to the compiler, allowing the user
to override (parts of) $(STRICT_CFLAGS) by adding -Wno-foo to CFLAGS.

We use the opportunity to regroup the various options a little.

7 years agobuild: Let .d files depend only on .c.
Andre Noll [Sat, 16 Jul 2016 20:24:12 +0000 (22:24 +0200)]
build: Let .d files depend only on .c.

Currently we let each .d file depend on the same set of files as the
.o file by having two targets specified as arguments to -MT options
in the cc command that creates the .d file: one for the .d file and
one for the .o file.

This approach runs into problems if header files are removed and the
now stale .d file depends on a file which no longer exists.

It is enough to let the .d file depend only on the corresponding
.c file. In case an included file changes or is removed, the .c
file changes as well, so we already know we must build the object
file and can update the .d file at the same time, without running
cc twice. The -MMD option which is added to the usual cc command
instructs the compiler to create both the .d and the .o file in one go.

When creating the .o and .d files simultaneously, we don't need a
sed command to prepend the directory containing the .lsg.h headers
as these files are prerequisites of the object file being created,
so they are known to exist when the cc command is executed.

7 years agobuild: Don't create phony targets for dependencies.
Andre Noll [Sat, 16 Jul 2016 11:43:52 +0000 (13:43 +0200)]
build: Don't create phony targets for dependencies.

The -MP option is supposed to work around make errors after a header
file was removed. However, with the option enabled, the attempt to
include a non-existing header file causes the build to loop endlessly.

7 years agobuild: Remove duplicate dependency.
Andre Noll [Sat, 16 Jul 2016 10:14:50 +0000 (12:14 +0200)]
build: Remove duplicate dependency.

We already defined the dependency on $(man_util_command_lists) a few
lines earlier.

7 years agobuild: Remove cmdline_dir and friends.
Andre Noll [Sun, 10 Jul 2016 16:33:48 +0000 (18:33 +0200)]
build: Remove cmdline_dir and friends.

This directory used to contain the source files of the command line
parsers generated by gengetopt. There are no such files any more,
so the the receipts which compile these source files can go away and
we do not need to create the directory any more.

The special CFLAGS for compiling those files can be removed as well
as the include directive for CPPFLAGS.

Finally, the make construct which filters out the .cmdline.d files
from the list of dependency files is no longer needed, and we may get
rid of the sed command which prepends $(cmdline_dir) to the includes
of the dependency files.

7 years agobuild: Remove some unused variables from Makefile.real.
Andre Noll [Wed, 29 Jun 2016 20:21:35 +0000 (22:21 +0200)]
build: Remove some unused variables from Makefile.real.

All executables are converted, so $converted_executables is the same
as $executables, modulo executables which can not be built (and are
thus irrelevant). Similarly, $unconverted_executables is empty and
can be removed as well.

The $m4_deps variable was only used for the gengetopt files, so this
can also be removed, along with $ggo_dir.

$help2man_dir used to contain the path to the directory for the output
files of help2man. Since we now generate the man pages with lopsubgen,
$help2man_dir has become unused and can be removed.

7 years agobuild: Remove m4/gengetopt.
Andre Noll [Sun, 26 Jun 2016 10:40:20 +0000 (12:40 +0200)]
build: Remove m4/gengetopt.

This directory only contained a single file: the makefile for
generating the command line parsers with gengetopt. Since we no longer
rely on gengetopt, we may remove $(m4_ggo_dir), m4/gengetopt/makefile
and the corresponding include directive in Makefile.real.

7 years agoRemove gengetopt and help2man checks from configure.ac.
Andre Noll [Sun, 26 Jun 2016 10:37:42 +0000 (12:37 +0200)]
Remove gengetopt and help2man checks from configure.ac.

The build system no longer depends on these tools, so the checks have
become unnecessary.

7 years agoRemove man_util.bash.
Andre Noll [Sun, 26 Jun 2016 10:33:44 +0000 (12:33 +0200)]
Remove man_util.bash.

This script is no longer needed since all executables and all command
lists have been converted to the lopsub library.

This commit removes the script and the receipt in Makefile.real that
called it.

7 years agoRemove ggo.c and ggo.h.
Andre Noll [Sun, 26 Jun 2016 10:30:28 +0000 (12:30 +0200)]
Remove ggo.c and ggo.h.

No source file includes ggo.h and none of the executables is linked
with ggo.o any more, so we may get rid of them.

7 years agomanual: Do not mention gengetopt and help2man any more.
Andre Noll [Sun, 26 Jun 2016 10:44:56 +0000 (12:44 +0200)]
manual: Do not mention gengetopt and help2man any more.

Both tools are no longer required to build the paraslash tree, so
there is no point to list them in the set of packages to install. The
patch also removes the links to the source code from the user manual.

7 years agoConvert para_server to lopsub.
Andre Noll [Fri, 24 Jun 2016 19:38:24 +0000 (21:38 +0200)]
Convert para_server to lopsub.

This is the last executable to be converted to lopsub.

acl_init() is removed from acl.c, and the initialization of the access
control list is moved to init_sender_status() of send_common.c. It
now takes an lls_opt_result argument and calls acl_add_entry() for
each argument given. The latter function needs to be made public.

In dccp_send.c we check the FEC parameters and change the gengetopt
config structure to contain the default values if invalid FEC
parameters were given. With lopsub this is no longer possible as
the lls_parse_result structure is opaque. We copy the FEC parameters
to a dccp_fec_client structure anyway, so is it easiest to move the
check there.

The patch removes the unused gengetopt option files but leaves the
gengetopt infrastructure of the build system in place. The build
system will be cleaned up in subsequent patches.