paraslash.git
2 years agoTeach writers to abort gracefully on early EOF.
Andre Noll [Sun, 5 Sep 2021 18:16:59 +0000 (20:16 +0200)]
Teach writers to abort gracefully on early EOF.

For very short streams it may happen that the receiver and decoder
unregister themselves from the buffer tree before the writer had a
chance to query the information from the decoder which it needs to
open the audio device. This leads to errors such as

Aug 25 14:24:51 schubert (5) get_btr_value: cmd sample_rate: Operation not supported
Aug 25 14:24:51 schubert (5) get_btr_value: cmd channels: Operation not supported
Aug 25 14:24:51 schubert (5) get_btr_value: cmd sample_format: Operation not supported
Aug 25 14:24:51 schubert (4) alsa_init: channels count not available: Invalid argument

This may happen with all receivers, audio formats and writers,
although it is most common with ogg streams.

This commit changes get_btr_sample_rate() and friends to return a
standard error code rather than assuming success. The alsa, ao and
oss writers are patched to check the return value and fail gracefully
if one of these functions fails.

2 years agoalsa_write: Simplify alsa_post_select().
Andre Noll [Sun, 5 Sep 2021 16:57:28 +0000 (18:57 +0200)]
alsa_write: Simplify alsa_post_select().

Clean up the private alsa data structure in alsa_close() and teach
this function to DTRT even if pad->handle is NULL because alsa_init()
failed.

2 years agoclient_common: Improve documentation of client_{pre,post}_select().
Andre Noll [Tue, 5 Oct 2021 19:31:06 +0000 (21:31 +0200)]
client_common: Improve documentation of client_{pre,post}_select().

It was outdated and not worded very well. In particular, it referred
to a task pointer although the argument is named "context". Also,
client_open() does not return a "client data structure", so talk
about the effect of that function rather than its return value.

2 years agocompress: Demote log level of clip message.
Andre Noll [Sat, 9 Oct 2021 17:42:52 +0000 (19:42 +0200)]
compress: Demote log level of clip message.

These messages trigger from time to time without having much audible
effect, so they are usually not serious.

2 years agoRemove ->fd of struct audio file data.
Andre Noll [Sun, 5 Sep 2021 20:38:41 +0000 (22:38 +0200)]
Remove ->fd of struct audio file data.

This structure contains information about the next audio file. It
is stored in a shared memory area, and a reference to this area is
sent through a pipe from the afs process to the server process. The
file descriptor of the next audio file, however, must be passed via
Unix socket magic (SCM_RIGHTS) and thus does not need to be part of
the structure.

Moreover, it's easier to define the afd structure in
open_and_update_audio_file() of aft.c rather than in its caller,
open_next_audio_file() of afs.c, because the caller only needs the
fd of the audio file and the shared memory ID but not the audio file
data structure itself.

Expand the documentation of open_and_update_audio_file() a bit while
at it.

2 years agoaudiod: Use para_malloc().
Andre Noll [Sat, 9 Oct 2021 15:20:06 +0000 (17:20 +0200)]
audiod: Use para_malloc().

If the allocation fails we feed NULL to strncpy(3) which should
result in a segfault. With para_malloc() a clear error message will
be shown instead.

Found by gcc's -fanalyzer option.

2 years agosync_filter: Silence noisy warning.
Andre Noll [Sun, 19 Sep 2021 15:08:40 +0000 (17:08 +0200)]
sync_filter: Silence noisy warning.

It's perfectly fine to fail here due to EOF, so don't print a log
message in this case.

2 years agoafs: Improve error diagnostics if no admissible files are found.
Andre Noll [Sun, 5 Sep 2021 19:36:55 +0000 (21:36 +0200)]
afs: Improve error diagnostics if no admissible files are found.

Currently, the server prints something like the following with
loglevel error:

Sep 05 21:19:42 (4) (31845) open_next_audio_file: key not found in rbtree
Sep 05 21:19:42 (4) (31844) recv_afs_result: afs code: 1, expected: 0
Sep 05 21:19:42 (4) (31844) recv_afs_result: did not receive open fd from afs

This is both cryptic and scary, given that this error is handled by
simply clearing the play bit from the vss status flags.

This commit changes the code to only print one clear log message with
loglevel notice:

Sep 05 21:34:45 (3) (5233) log_statistics: no admissible files

2 years agoplay: Avoid gcc warning when compiling without readline.
Andre Noll [Tue, 28 Sep 2021 20:05:45 +0000 (22:05 +0200)]
play: Avoid gcc warning when compiling without readline.

The EXPORT_PLAY_CMD_HANDLER() macro is only used when READLINE support
is enabled, which leads to

play.c:112: warning: macro "EXPORT_PLAY_CMD_HANDLER" is not used [-Wunused-macros]

Define the macro only when HAVE_READLINE is defined by moving down
the definition to the first user, com_quit().

2 years agoserver: Wait for command handler exit also when afs dies.
Andre Noll [Tue, 21 Sep 2021 12:09:39 +0000 (14:09 +0200)]
server: Wait for command handler exit also when afs dies.

When para_server is running in foreground mode in a terminal session,
and gets signalled by hitting CTRL+C, it is unspecified whether the
server or the afs process receive the resulting SIGINT first. It may
even happen that the afs process dies first, and that the server sees
the resulting SIGCHLD *before* the SIGINT.

In this case we currently don't wait for the command handlers to exit
but proceed right away with the shutdown, closing the signal pipe and
destroying the shared memory area which contains the mmd structure.
This leads to error messages on shutdown such as

Sep 21 12:38:18 (5) (29166) para_semop: semaphore set 12648470 was removed
Sep 21 12:38:18 (6) (29166) para_semop: fatal semop error Invalid argument: pid 29166
Sep 21 12:38:18 (6) (29161) generic_signal_handler: Bad file descriptor
Sep 21 12:38:18 (6) (29164) para_semop: fatal semop error Invalid argument: pid 29164
Sep 21 12:38:18 (6) (29165) command_handler_sighandler: terminating on signal 15
Sep 21 12:38:18 (6) (29165) para_semop: fatal semop error Invalid argument: pid 29165

This commit avoids the issue by letting the server wait for all
its children also in the SIGCHILD case when we exit because the afs
process has terminated.

2 years agovss: Avoid double free on exit.
Andre Noll [Mon, 20 Sep 2021 18:42:37 +0000 (20:42 +0200)]
vss: Avoid double free on exit.

When para_server fails to receive the fd for the next audio file,
the memory pointed to by mmd->afd.afhi.chunk_table is freed but the
pointer is not set to NULL. If the failure was due to server and afs
receiving SIGINT, the subsequent signal handling code might attempt
to free the chunk table again. This double free error is detected by
glibc, which results resulting in messages such as

free(): invalid size
Aborted

Fortunately, this is easy to fix.

2 years agovss: Handle empty chunk groups gracefully.
Andre Noll [Mon, 20 Sep 2021 17:15:12 +0000 (19:15 +0200)]
vss: Handle empty chunk groups gracefully.

The assertion in compute_group_size() triggers if the stream is
positioned right at the end of the file when the next chunk group
starts. This was observed with an mp3 file and the udp sender when
pausing and restarting the stream at the end of the file.

Fix this braino by returning EOF instead of aborting if the next
chunk group happens to be empty.

2 years agoupd sender: Don't send FEC EOF from command handler context.
Andre Noll [Mon, 20 Sep 2021 18:28:42 +0000 (20:28 +0200)]
upd sender: Don't send FEC EOF from command handler context.

Without this, the EOF packet might be sent twice: once by the command
handler which stopped the stream and once by the server process. This
does not hurt, but results in additional unnecessary network traffic,
so return early from udp_close_target() when we're running in command
handler context.

2 years agoafh: Avoid memory leak at exit.
Andre Noll [Thu, 26 Aug 2021 17:31:25 +0000 (19:31 +0200)]
afh: Avoid memory leak at exit.

We missed to free the lopsub parse result. This is not a real leak
because it's a one-off allocation and we are about to exit anyway. It's
worth to fix nevertheless, though, because with the patch applied,
valgrind says "no leaks are possible". Hence any other output means
we have introduced a new memory leak.

2 years agoaac_afh: Fix check of return value of mp4ff_meta_update().
Andre Noll [Fri, 13 Aug 2021 19:47:47 +0000 (21:47 +0200)]
aac_afh: Fix check of return value of mp4ff_meta_update().

This function returns zero on failure, and one on success, so the
current check for a negative return value is incorrect. The call to
mp4ff_meta_get_by_index() suffers from the same mistake.

2 years agocom_jmp(): Handle negative values gracefully.
Andre Noll [Sat, 3 Jul 2021 12:36:43 +0000 (14:36 +0200)]
com_jmp(): Handle negative values gracefully.

Currently these get silently converted to a (large) unsigned number,
which causes para_server to skip to the next audio file. This patch
modifies the command handler to check whether the given value is
within range and fails the command if it is out of range.

Remove an uninteresting log message while at it.

2 years agoserver.c: Fix double "the" in comment.
Andre Noll [Sat, 28 Aug 2021 14:43:45 +0000 (16:43 +0200)]
server.c: Fix double "the" in comment.

Found by the vim spell checker.

2 years agoMerge branch 'maint'
Andre Noll [Mon, 30 Aug 2021 18:33:40 +0000 (20:33 +0200)]
Merge branch 'maint'

Just one cherry-picked commit to make the maint branch compile with
newer glibc.

* maint:
  Avoid warning about sys/sysctl.h on glibc-2.30.

2 years agoAvoid warning about sys/sysctl.h on glibc-2.30.
Andre Noll [Tue, 20 Aug 2019 07:10:53 +0000 (09:10 +0200)]
Avoid warning about sys/sysctl.h on glibc-2.30.

From glibc-2.30 NEWS:

The Linux-specific <sys/sysctl.h> header and the sysctl function have
been deprecated and will be removed from a future version of glibc.

Compilation against the glibc-2.30 headers results in the following warning:

In file included from ipc.c:10:
/usr/include/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]

On NetBSD and FreeBSD, however, we still need to include the header
to get the declaration of sysctlbyname(3).

This patch changes ipc.c to include sys/sysctl.h only if __FreeBSD__ or
__NetBSD__ is defined.  Also remove the pointless check for __APPLE__.

2 years agoplay: Create ~/.paraslash.
Andre Noll [Tue, 25 May 2021 15:10:16 +0000 (17:10 +0200)]
play: Create ~/.paraslash.

Currently para_play won't save its history if this directory does
not exist. This patch makes it create the directory at startup.

2 years agoclient.c: Fix typo in comment.
Andre Noll [Thu, 27 May 2021 14:59:10 +0000 (16:59 +0200)]
client.c: Fix typo in comment.

2 years agomanual: Fix package name of flac library.
Andre Noll [Tue, 25 May 2021 15:09:17 +0000 (17:09 +0200)]
manual: Fix package name of flac library.

These days it is spellt lower case. Also realpath is not a separate
package anymore, so drop that.

2 years agoUpdate copyright year.
Andre Noll [Tue, 25 May 2021 15:08:30 +0000 (17:08 +0200)]
Update copyright year.

2 years agoINSTALL: Fix instructions for compiling from git.
Andre Noll [Tue, 25 May 2021 15:07:43 +0000 (17:07 +0200)]
INSTALL: Fix instructions for compiling from git.

The command line lacked the configure command.

2 years agoserver: Don't crash on blank moods.
Andre Noll [Thu, 6 May 2021 18:29:06 +0000 (20:29 +0200)]
server: Don't crash on blank moods.

We special-case empty mood definitions (because we can't map the
osl object anyway), but we don't check whether the mood definition
contains anything else than whitespace or comments.

Such blank mood definitions result in an empty abstract syntax tree
indicated by ->ast of the mood parser's context structure being
NULL. We happily dereference that pointer in mp_eval_row() and die
by the resulting SIGSEGV.

The fix is trivial: simply treat blank moods in the same way as the
dummy mood, i.e. regard each audio file as admissible.

2 years agoaft: Silence format-overflow warning with gcc-10.
Andre Noll [Wed, 28 Apr 2021 11:17:03 +0000 (13:17 +0200)]
aft: Silence format-overflow warning with gcc-10.

aft.c: In function 'print_list_item':
aft.c:736:17: warning: '%*u' directive writing between 1 and 65529 bytes into a region of size 30 [-Wformat-overflow=]
  736 |   sprintf(buf, "%*u:%02u:%02d", max_width - 6, hours, mins,
      |                 ^~~
aft.c:736:16: note: directive argument in the range [1, 4294967295]
  736 |   sprintf(buf, "%*u:%02u:%02d", max_width - 6, hours, mins,
      |                ^~~~~~~~~~~~~~~
aft.c:736:16: note: directive argument in the range [-59, 59]
aft.c:736:3: note: 'sprintf' output between 8 and 65545 bytes into a destination of size 30
  736 |   sprintf(buf, "%*u:%02u:%02d", max_width - 6, hours, mins,
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  737 |    seconds % 60);
      |    ~~~~~~~~~~~~~

The code is correct but gcc can't prove it. Silence the warning by
passing the size of the buffer and asserting that it won't overflow
before printing to it.

3 years agomanual: Fix dead audiocoding.com link.
Andre Noll [Thu, 8 Apr 2021 15:12:02 +0000 (17:12 +0200)]
manual: Fix dead audiocoding.com link.

As pointed out by Sven, audiocoding.com has been out of service and
shut down the website since August of 2020. The library is still
available for download on the sourceforge project page, so link to
that page instead.

Reported-by: Sven <sven.videoproc@gmail.com>
3 years agoprebuffer: Remove buffer tree node on errors.
Andre Noll [Mon, 5 Apr 2021 18:29:28 +0000 (20:29 +0200)]
prebuffer: Remove buffer tree node on errors.

When the ->post_select method of a filter returns negative, it *must*
remove its buffer tree node as well. The prebuffer missed to do that,
which results in a stale reference to the buffer tree which keeps
the audiod slot busy. When no more slots are free, audiod hangs or
exits with a "no more free slots" message. This patch avoids this.

3 years agoparaslash 0.6.3 v0.6.3
Andre Noll [Thu, 18 Feb 2021 16:46:13 +0000 (17:46 +0100)]
paraslash 0.6.3

3 years agoalsa_write: Avoid hung tasks.
Andre Noll [Thu, 7 Jan 2021 23:55:13 +0000 (00:55 +0100)]
alsa_write: Avoid hung tasks.

Without this fix the alsa writer may never shutdown, occupying a
slot of audiod. The hang was observed with in conjunction to the
udp receiver and the prebuffer filter. See also the recent commit
23913cbbfc98.

3 years agoMerge branch 'refs/heads/t/fec'
Andre Noll [Fri, 1 Jan 2021 15:14:13 +0000 (16:14 +0100)]
Merge branch 'refs/heads/t/fec'

A single patch which improves the memory management of the
fec encoder.

Cooking for half a year.

* refs/heads/t/fec:
  vss: Fix NULL pointer dereference in vss_del_fec_client().
  vss: Rework fec client setup.

3 years agogui: Fix length of audio format field.
Andre Noll [Thu, 22 Oct 2020 15:50:06 +0000 (17:50 +0200)]
gui: Fix length of audio format field.

Without this, the contents of the subsequent item (numplayed) are
overwritten by spaces. This only affects the colorful blackness theme.

3 years agoaft: Avoid NULL pointer dereference.
Andre Noll [Fri, 16 Oct 2020 13:49:47 +0000 (15:49 +0200)]
aft: Avoid NULL pointer dereference.

osl_get_object() must not be called with a NULL row pointer. Currently
this may happen on blob events. This patch avoids the problem and
makes sure we catch this programming error early.

3 years agoprebuffer: Bail out on bufffer tree errors.
Andre Noll [Fri, 1 Jan 2021 15:05:56 +0000 (16:05 +0100)]
prebuffer: Bail out on bufffer tree errors.

Without this, the prebuffer filter might stay active forever, occupying
a slot of para_audiod until no more slots are available. This was
observed with the udp receiver.

3 years agoReplace /* fallthrouth*/ by __attribute__ ((fallthrough));
Andre Noll [Mon, 1 Jun 2020 17:28:01 +0000 (19:28 +0200)]
Replace /* fallthrouth*/ by __attribute__ ((fallthrough));

Some (recent) gcc versions still complain because the switch case
falls through. The new code causes a warning on old compilers which
don't know the fallthrough attribute, but this is still better than
seeing the warning on systems with a recent compiler.

3 years agoaft: Avoid invalid read.
Andre Noll [Fri, 29 May 2020 23:22:49 +0000 (01:22 +0200)]
aft: Avoid invalid read.

A short chunk table is fatal for all audio formats except aac,
which employs dynamic chunks. The below valgrind spat was found when
para_server tried to open an aac audio file. Setting afhi->chunk_table
to NULL in this case should fix it.

==17667== Invalid read of size 4
==17667==    at 0x805A862: write_u32 (portable_io.h:95)
==17667==    by 0x805A862: save_chunk_table (aft.c:402)
==17667==    by 0x805A862: save_chunk_table (aft.c:395)
==17667==    by 0x805DDE6: save_afd (aft.c:616)
==17667==    by 0x805DDE6: open_and_update_audio_file (aft.c:1113)
==17667==    by 0x8058AA2: open_next_audio_file (afs.c:425)
==17667==    by 0x8058AA2: execute_server_command (afs.c:867)
==17667==    by 0x8058AA2: command_post_select.part.0 (afs.c:921)
==17667==    by 0x8063062: call_post_select (sched.c:80)
==17667==    by 0x8063062: sched_post_select (sched.c:106)
==17667==    by 0x8063062: schedule (sched.c:159)
==17667==    by 0x8059643: afs_init (afs.c:1006)
==17667==    by 0x804D747: init_afs (server.c:529)
==17667==    by 0x804D747: server_init (server.c:601)
==17667==    by 0x804D747: main (server.c:690)
==17667==  Address 0x4d7dcd0 is 0 bytes after a block of size 40 alloc'd
==17667==    at 0x40365E2: malloc (vg_replace_malloc.c:309)
==17667==    by 0x8053AB6: para_malloc (string.c:63)
==17667==    by 0x805B20D: load_chunk_table (aft.c:415)
==17667==    by 0x805DD65: open_and_update_audio_file (aft.c:1103)
==17667==    by 0x8058AA2: open_next_audio_file (afs.c:425)
==17667==    by 0x8058AA2: execute_server_command (afs.c:867)
==17667==    by 0x8058AA2: command_post_select.part.0 (afs.c:921)
==17667==    by 0x8063062: call_post_select (sched.c:80)
==17667==    by 0x8063062: sched_post_select (sched.c:106)
==17667==    by 0x8063062: schedule (sched.c:159)
==17667==    by 0x8059643: afs_init (afs.c:1006)
==17667==    by 0x804D747: init_afs (server.c:529)
==17667==    by 0x804D747: server_init (server.c:601)
==17667==    by 0x804D747: main (server.c:690)

3 years agomp: Always set mp_context to NULL on errors.
Andre Noll [Mon, 16 Mar 2020 17:44:07 +0000 (18:44 +0100)]
mp: Always set mp_context to NULL on errors.

In mp_init(), if mp_yyparse() fails, we return early without setting
the result pointer to NULL. This does not matter much because both
callers of mood.c pass in NULL, but still..

3 years agogui: Do not decode the pressed key multiple times.
Andre Noll [Tue, 28 Apr 2020 19:58:47 +0000 (21:58 +0200)]
gui: Do not decode the pressed key multiple times.

Although the key name is a loop invariant, we recompute it during
every iteration of the loop. Fix this.

3 years agogui: Have km_keyname() return const.
Andre Noll [Tue, 28 Apr 2020 19:56:38 +0000 (21:56 +0200)]
gui: Have km_keyname() return const.

We neither want the caller to write there nor to free the memory.

3 years agoserver: Add --dccp-no-autostart.
Andre Noll [Tue, 17 Mar 2020 11:43:55 +0000 (12:43 +0100)]
server: Add --dccp-no-autostart.

We already have --http-no-autostart and --udp-no-autostart. Add the
new option for consistency.

3 years agovss: Fix NULL pointer dereference in vss_del_fec_client().
Andre Noll [Sun, 19 Jul 2020 16:35:44 +0000 (18:35 +0200)]
vss: Fix NULL pointer dereference in vss_del_fec_client().

fc->src_data may well be NULL here, for example if para_server is
not currently playing.

This bug was introduced in the previous commit after the topic branch
had been promoted to next.

3 years agoafs: Improve error diagnostics.
Andre Noll [Sat, 14 Mar 2020 09:33:40 +0000 (10:33 +0100)]
afs: Improve error diagnostics.

If an afs table can not be opened, we miss to log the error reason.
Also, if the audio file table does not exist, state this fact
explicitly.

3 years agodoc: Add missing \ref in crypt.h.
Andre Noll [Thu, 12 Mar 2020 14:32:20 +0000 (15:32 +0100)]
doc: Add missing \ref in crypt.h.

This way, we get a warning when the name of the function changes but
the comment is left unmodified.

3 years agocrypt_common: Constify hash pointers.
Andre Noll [Thu, 12 Mar 2020 15:27:16 +0000 (16:27 +0100)]
crypt_common: Constify hash pointers.

hash_to_asc() and hash_compare() only read from the memory locations
given by these pointers.

3 years agovss: Rework fec client setup.
Andre Noll [Fri, 12 Jun 2020 01:34:32 +0000 (03:34 +0200)]
vss: Rework fec client setup.

The current fec code assumes that the chunks of the audio file form a
contigous buffer. At least for aac/m4a this is not true, which is
why streaming m4a files over udp never worked well.

This patch should be a big improvement in this regard. We now copy
the chunks to preallocated buffers, which also makes the code easier
to follow because we can get rid of the two extra buffers in struct
fec_client.

3 years agovss.c: Fix typo in comment.
Andre Noll [Thu, 28 May 2020 13:29:37 +0000 (15:29 +0200)]
vss.c: Fix typo in comment.

3 years agogui: Adjust position of num_played value.
Andre Noll [Sat, 6 Jun 2020 16:50:48 +0000 (18:50 +0200)]
gui: Adjust position of num_played value.

If the terminal window is only 80 characters wide, the num_played
value may be adjacent to the bitrate value, with no space between.
This happens only if the num_played value is bigger than 99, and only
with the "colorful blackness" theme.

This simple patch should fix the issue.

3 years agoAvoid audiod hangs when prebuffer filter is active.
Andre Noll [Thu, 11 Jun 2020 13:28:49 +0000 (15:28 +0200)]
Avoid audiod hangs when prebuffer filter is active.

This filter misses to honor task notifications. As a result of this
omission, when CTRL+C is pressed while audiod is running in foreground
mode and the prebuffer filter is active, the audiod process hangs.

The fix is obvious.

3 years agoMerge branch 'refs/heads/t/para_play'
Andre Noll [Sat, 16 May 2020 10:14:23 +0000 (12:14 +0200)]
Merge branch 'refs/heads/t/para_play'

A single patch which adds --end-of-playlist to control the behaviour
of para_play when the end of the playlist is reached.

Cooking for three weeks.

* refs/heads/t/para_play:
  play: New option: --end-of-playlist.

3 years agoUpdate copyright year.
Andre Noll [Sat, 11 Apr 2020 16:24:45 +0000 (18:24 +0200)]
Update copyright year.

Fortunately, there is only a single location that needs to be
updated.

3 years agoaft: Update afhi after addblob.
Andre Noll [Wed, 29 Apr 2020 15:48:09 +0000 (17:48 +0200)]
aft: Update afhi after addblob.

The old status_item_ls_data.afhi might refer to unmapped memory.

4 years agoMerge branch 'refs/heads/t/stale-pointer-fix'
Andre Noll [Mon, 23 Mar 2020 20:19:14 +0000 (21:19 +0100)]
Merge branch 'refs/heads/t/stale-pointer-fix'

This bug only triggered if the kernel changes the address of the memory
mapping of the audio file table after a file was added, and a subsequent
operation would access the then stale pointer.

Cooking for a week.

* refs/heads/t/stale-pointer-fix:
  Don't use strdup() to copy hash.
  aft: Avoid stale pointer pointer reference.

4 years agoDon't use strdup() to copy hash.
Andre Noll [Tue, 17 Mar 2020 15:18:22 +0000 (16:18 +0100)]
Don't use strdup() to copy hash.

There was a braino in the previous patch: the hash may well contain
a zero byte, so we need to use memcpy().

4 years agocommand.c: Improve documentation of handle_connect().
Andre Noll [Tue, 17 Mar 2020 08:30:22 +0000 (09:30 +0100)]
command.c: Improve documentation of handle_connect().

This text was not very precise, and it had some language issues.

4 years ago.gitignore: Remove web/dia/overview.pdf.
Andre Noll [Sun, 15 Mar 2020 13:53:35 +0000 (14:53 +0100)]
.gitignore: Remove web/dia/overview.pdf.

The overview has been removed long ago.

4 years agoaft: Avoid stale pointer pointer reference.
Andre Noll [Sun, 2 Feb 2020 15:26:16 +0000 (16:26 +0100)]
aft: Avoid stale pointer pointer reference.

We can't rely on the ->hash and ->path pointers of struct
status_item_ls_data because they both become stale when the audio
file table gets remapped. This happens for example when a new audio
file is added while another audio file is currently open. A subsequent
addblob command then triggers a re-initialization of the status items,
which reads from the stale pointer location.

This usually results in garbage in the stat output, but can also lead
to a segfault or worse. Avoid this from happening by creating a copy
of the hash and the path.

This bug has been present for a long time. It was hard to debug
because often no invalid memory accesses occur, hence valgrind does
not complain.

4 years agoMerge branch 'refs/heads/t/mixer'
Andre Noll [Sun, 15 Mar 2020 14:51:20 +0000 (15:51 +0100)]
Merge branch 'refs/heads/t/mixer'

A single patch for para_mixer which makes the subcommands which
sleep a bit more robust.

The merge conflicted due to commit d6b25bf854c1 (mixer: fade: Handle
empty mood strings gracefully) from half a year ago, but the resolution
was obvious.

Cooking for nine months.

* refs/heads/t/mixer:
  mixer: sleep/snooze: Close mixer during sleep.

4 years agoafs.c: Remove two pointless casts.
Andre Noll [Thu, 5 Mar 2020 17:50:55 +0000 (18:50 +0100)]
afs.c: Remove two pointless casts.

The type of ->data is void *, so no casts are needed.

4 years agomp3_afh: Don't bail out on short files.
Andre Noll [Sun, 24 Nov 2019 16:33:51 +0000 (17:33 +0100)]
mp3_afh: Don't bail out on short files.

It's perfectly OK to have mp3 files which are shorter than two seconds.
For example lexico.com offers mp3 downloads to learn the pronuciation
of single words. These files are often shorter than one second.

The check for short length files predates the git history. Most likely
it was added for no good reason, so drop it.

4 years agoopenssl: Fix (harmless) memory leaks at exit.
Andre Noll [Wed, 11 Sep 2019 20:12:32 +0000 (22:12 +0200)]
openssl: Fix (harmless) memory leaks at exit.

Without this, valgrind --leak-check=full --show-leak-kinds=all
complains about four memory blocks reachable at exit, see below.

The first leak is fixed by the new call to ERR_remove_thread_state(),
which frees the error queue of the current thread. To squash the
other three, the call to EVP_cleanup() is needed to remove all of
openssl's internal ciphers and digests.

To make this work on both openssl-1.0 and for openssl-1.1, we need
to add additional header checks for configure.

---
==2818== 12 bytes in 1 blocks are still reachable in loss record 1 of 4
==2818==    at 0x40355EE: malloc (vg_replace_malloc.c:309)
==2818==    by 0x41B887C: CRYPTO_malloc (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x42459B7: lh_insert (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4248542: int_thread_set_item (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4249920: ERR_get_state (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x424A255: ERR_put_error (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4222EF6: RSA_padding_check_PKCS1_OAEP_mgf1 (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x422306A: RSA_padding_check_PKCS1_OAEP (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x421F921: RSA_eay_private_decrypt (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x804F2E9: apc_priv_decrypt (openssl.c:206)
==2818==    by 0x804DB59: client_post_select (client_common.c:321)
==2818==    by 0x804CC57: call_post_select (sched.c:80)
==2818==    by 0x804CC57: sched_post_select (sched.c:106)
==2818==    by 0x804CC57: schedule (sched.c:159)
==2818==
==2818== 64 bytes in 1 blocks are still reachable in loss record 2 of 4
==2818==    at 0x40355EE: malloc (vg_replace_malloc.c:309)
==2818==    by 0x41B887C: CRYPTO_malloc (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4245643: lh_new (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x424811F: int_thread_get (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4248511: int_thread_set_item (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4249920: ERR_get_state (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x424A255: ERR_put_error (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4222EF6: RSA_padding_check_PKCS1_OAEP_mgf1 (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x422306A: RSA_padding_check_PKCS1_OAEP (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x421F921: RSA_eay_private_decrypt (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x804F2E9: apc_priv_decrypt (openssl.c:206)
==2818==    by 0x804DB59: client_post_select (client_common.c:321)
==2818==
==2818== 96 bytes in 1 blocks are still reachable in loss record 3 of 4
==2818==    at 0x40355EE: malloc (vg_replace_malloc.c:309)
==2818==    by 0x41B887C: CRYPTO_malloc (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4245628: lh_new (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x424811F: int_thread_get (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4248511: int_thread_set_item (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4249920: ERR_get_state (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x424A255: ERR_put_error (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4222EF6: RSA_padding_check_PKCS1_OAEP_mgf1 (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x422306A: RSA_padding_check_PKCS1_OAEP (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x421F921: RSA_eay_private_decrypt (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x804F2E9: apc_priv_decrypt (openssl.c:206)
==2818==    by 0x804DB59: client_post_select (client_common.c:321)
==2818==
==2818== 400 bytes in 1 blocks are still reachable in loss record 4 of 4
==2818==    at 0x40355EE: malloc (vg_replace_malloc.c:309)
==2818==    by 0x41B887C: CRYPTO_malloc (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x424988C: ERR_get_state (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x424A255: ERR_put_error (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x4222EF6: RSA_padding_check_PKCS1_OAEP_mgf1 (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x422306A: RSA_padding_check_PKCS1_OAEP (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x421F921: RSA_eay_private_decrypt (in /usr/local/lib/libcrypto.so.1.0.0)
==2818==    by 0x804F2E9: apc_priv_decrypt (openssl.c:206)
==2818==    by 0x804DB59: client_post_select (client_common.c:321)
==2818==    by 0x804CC57: call_post_select (sched.c:80)
==2818==    by 0x804CC57: sched_post_select (sched.c:106)
==2818==    by 0x804CC57: schedule (sched.c:159)
==2818==    by 0x804AB2D: main (client.c:656)

4 years agoMerge branch 'refs/heads/t/ogg_afh'
Andre Noll [Fri, 28 Feb 2020 17:13:50 +0000 (18:13 +0100)]
Merge branch 'refs/heads/t/ogg_afh'

A patch which teaches the ogg/* audio format handlers to report the
correct length for files with holes. A bug was found in that patch
after the branch had been merged to next, so there's a fixup commit
on top.

The second patch in this series fixes an issue with
ogg_page_granulepos() that can result in incorrect estimates for the
duration of files that use the ogg container format.

Cooking for a year.

* refs/heads/t/ogg_afh:
  ogg_afh_common.c: Check return value of ogg_page_granulepos().
  ogg_afh_common: Fix signedness issue.
  ogg: Detect missing ogg pages.

4 years agovss: Improve error diagnostics.
Andre Noll [Sat, 2 Nov 2019 13:47:15 +0000 (14:47 +0100)]
vss: Improve error diagnostics.

Unless in debug loglevel, para_server prints

Nov 01 17:06:03 (4) (18596) open_next_audio_file: key not found in rbtree
Nov 01 17:06:03 (4) (18595) recv_afs_result: did not receive open fd from afs

which does not include information about what was actually received.

4 years agovss: Fix harmless memory leaks at exit.
Andre Noll [Sun, 1 Sep 2019 12:26:40 +0000 (14:26 +0200)]
vss: Fix harmless memory leaks at exit.

The leaks were introduced in commit 4fbe16430b47 (server: Add
--http-listen-address and --dccp-listen-address) from last year.

Found by valgrind.

4 years agomp3_afh: Fix whitespace issue in debug log message.
Andre Noll [Sun, 24 Nov 2019 16:32:29 +0000 (17:32 +0100)]
mp3_afh: Fix whitespace issue in debug log message.

There was no space character between the number and the word
"chunks". Add it.

4 years agocommand.c: Also invalidate play time if no audio file is open.
Andre Noll [Sat, 2 Nov 2019 13:59:29 +0000 (14:59 +0100)]
command.c: Also invalidate play time if no audio file is open.

Without this, the time string of the previous audio file is continued
to be shown in the top window of para_gui when stopped. It gets
wiped out eventually, but this can take a few seconds. With the patch
applied, the time string disappears immediately.

4 years agoMerge branch 'refs/heads/t/ssh'
Andre Noll [Sat, 23 Nov 2019 17:20:21 +0000 (18:20 +0100)]
Merge branch 'refs/heads/t/ssh'

A medium sized series which teaches both crypto backends about the
RFC4716 key format, which has become the default for ssh-keygen as
of openssh-7.8.

Was cooking for almost a year.

* refs/heads/t/ssh:
  manual: Instruct the user to create RFC4716 keys.
  openssl: Add support for RFC4716 keys
  openssl: Move get_private_key() down.
  gcrypt: Add support for RFC4716 private keys.
  crypt: Rename decoding functions.
  gcrypt: Introduce read_openssh_bignum().
  gcrypt: Factor out read_pem_rsa_params().
  gcrypt: Let read_bignum() return bits, not bytes.
  gcrypt: Let decode_key() return blob size through additional argument.
  gcrypt: Drop unnecessary arguments of decode_key().

4 years agomixer: fade: Handle empty mood strings gracefully.
Andre Noll [Sun, 1 Sep 2019 08:20:37 +0000 (10:20 +0200)]
mixer: fade: Handle empty mood strings gracefully.

Treat them as if the option was not given to prevent "para_client
select" to fail.

4 years agoMerge branch 'refs/heads/t/openssl-header-check'
Andre Noll [Sat, 2 Nov 2019 15:43:59 +0000 (16:43 +0100)]
Merge branch 'refs/heads/t/openssl-header-check'

* refs/heads/t/openssl-header-check:
  build: Check also for CRYPTO_cleanup_all_ex_data.
  build: Detect openssl library/header mismatch.

Two simple fixes for FreeBSD. Tested on 12.0-RELEASE-p10.

Cooking for nine months.

4 years agoerror.h: Document LLS_ERROR_BIT.
Andre Noll [Fri, 13 Sep 2019 06:30:47 +0000 (08:30 +0200)]
error.h: Document LLS_ERROR_BIT.

Also reformat the similar comment of OSL_ERROR_BIT to make it fit
into a single line.

4 years agosend.h: Document cpp magic.
Andre Noll [Wed, 11 Sep 2019 20:52:52 +0000 (22:52 +0200)]
send.h: Document cpp magic.

These macros are not completely trivial, so give the interested reader
an idea about how the macros help to avoid code duplication.

4 years agoSimplify and improve freep().
Andre Noll [Sun, 1 Sep 2019 11:41:01 +0000 (13:41 +0200)]
Simplify and improve freep().

Make it a no-op if NULL is passed. Also the comment to \param was
slightly incorrect and the code contained an unnecessary cast.

4 years agoMerge branch 'refs/heads/t/ONESHELL'
Andre Noll [Sun, 8 Sep 2019 09:07:45 +0000 (11:07 +0200)]
Merge branch 'refs/heads/t/ONESHELL'

A single patch which instructs the build system to run multi-line
statements in Makefiles in a single shell instance.

Cooking in next for nine months.

* refs/heads/t/ONESHELL:
  build: Use .ONESHELL.

4 years agoAvoid warning about sys/sysctl.h on glibc-2.30.
Andre Noll [Tue, 20 Aug 2019 07:10:53 +0000 (09:10 +0200)]
Avoid warning about sys/sysctl.h on glibc-2.30.

From glibc-2.30 NEWS:

The Linux-specific <sys/sysctl.h> header and the sysctl function have
been deprecated and will be removed from a future version of glibc.

Compilation against the glibc-2.30 headers results in the following warning:

In file included from ipc.c:10:
/usr/include/sys/sysctl.h:21:2: warning: #warning "The <sys/sysctl.h> header is deprecated and will be removed." [-Wcpp]

On NetBSD and FreeBSD, however, we still need to include the header
to get the declaration of sysctlbyname(3).

This patch changes ipc.c to include sys/sysctl.h only if __FreeBSD__ or
__NetBSD__ is defined.  Also remove the pointless check for __APPLE__.

4 years agoMerge branch 'refs/heads/t/afh'
Andre Noll [Sun, 1 Sep 2019 11:18:41 +0000 (13:18 +0200)]
Merge branch 'refs/heads/t/afh'

A couple of patches which remove ->init of struct audio_format_handler
and struct receiver.

Cooking for 9 months.

* refs/heads/t/afh:
  Remove ->init() of struct receiver.
  afh: Constify definition of audio format handlers.
  afh: Introduce audio_format_names[].
  afh: Get rid of dummy entry at the end of afl[].
  afh: Minor simplification for afh_get_chunk().
  afh: Move audio_format_name() up.

4 years agoMerge branch 'refs/heads/t/compress'
Andre Noll [Sat, 24 Aug 2019 11:38:29 +0000 (13:38 +0200)]
Merge branch 'refs/heads/t/compress'

A short series which overhauls the algorithm behind the compress
filter and its documentation.

Cooking for almost a year.

* refs/heads/t/compress:
  compress: Overhaul the meaning of --aggressiveness.
  compress: Apply damping later.
  compress: Warn when samples are clipped.
  compress: Document and sanity-check command line options.
  compress: Fix off by one in help of --target-level.

4 years agoMerge branch 'refs/heads/t/afh-preserve'
Andre Noll [Sun, 28 Jul 2019 12:24:45 +0000 (14:24 +0200)]
Merge branch 'refs/heads/t/afh-preserve'

A single patch which adds --preserve to para_afh.

* refs/heads/t/afh-preserve:
  afh: Implement --preserve.

4 years agoMerge branch 'refs/heads/t/ff'
Andre Noll [Sun, 14 Jul 2019 10:56:19 +0000 (12:56 +0200)]
Merge branch 'refs/heads/t/ff'

A short series which overhauls the ff server command.

Cooking for almost a year (for no good reason).

* refs/heads/t/ff:
  com_ff(): Fix bad grammar in help text.
  com_ff(): Depreciate "n-" syntax.
  com_ff(): Simplify code for jumping backwards.
  com_ff(): Avoid "unsigned i".

4 years agoogg_afh_common.c: Check return value of ogg_page_granulepos().
Andre Noll [Thu, 4 Jul 2019 07:04:56 +0000 (09:04 +0200)]
ogg_afh_common.c: Check return value of ogg_page_granulepos().

This function may return -1, and we do not want to use a negative
granule position for the computation of the duration of the ogg file.

Note that oac_get_file_info() loops over all ogg pages twice, but
the second loop does not have the same problem as we already check
the return value there.

4 years agoogg_afh_common: Fix signedness issue.
Andre Noll [Thu, 6 Jun 2019 06:28:58 +0000 (08:28 +0200)]
ogg_afh_common: Fix signedness issue.

The previous patch introduced a regression because "granule" was made
unsigned by mistake but needs to be a signed variable. This can cause
the loop in oac_get_file_info() to not terminate which eventually
results in an abort due to an allocation failure:

para_realloc: realloc failed (size = 2097152000), aborting

4 years agocom_ff(): Fix bad grammar in help text.
Andre Noll [Sun, 2 Jun 2019 10:21:12 +0000 (12:21 +0200)]
com_ff(): Fix bad grammar in help text.

4 years agomixer: sleep/snooze: Close mixer during sleep.
Andre Noll [Sat, 23 Mar 2019 15:51:56 +0000 (16:51 +0100)]
mixer: sleep/snooze: Close mixer during sleep.

This makes these subcommands work in case the audio device goes away
temporarily during the sleep interval. This does not work at the moment
because we connect to the mixer only once at startup. The mixer handle
becomes invalid when the audio device goes away, so fade-in fails.

Another drawback of this "connect only once" design is that the
mixer device is opened even for the help subcommand, which is not
only silly but also has the effect that the help subcommand fails if
the mixer device can not be opened.

To improve on this, we have the individual subcommand handlers open and
close the mixer device. Consequently, the command handlers no longer
take a struct mixer_handle * argument. To obtain a mixer handle,
command handlers must now call the new open_mixer_and_set_channel()
at startup, and m->close() on return to free the handle.

4 years agoplay: New option: --end-of-playlist.
Andre Noll [Wed, 1 Aug 2018 12:13:07 +0000 (14:13 +0200)]
play: New option: --end-of-playlist.

If the end of the playlist is reached, para_play starts over with the
first file of the playlist. This commit provides the --end-of-playlist
option to control the behaviour. The new option has three pre-defined
values: stop, loop, quit with "loop" being the default. Since lopsub
features multi-valued options, the implementation is pretty simple.

5 years agoaft: Avoid invalid read.
Andre Noll [Sun, 27 Jan 2019 23:00:40 +0000 (00:00 +0100)]
aft: Avoid invalid read.

This happens with dynamic chunks. In this case we don't reserve any
space for the chunk table, yet the code copies one entry.

==6827== Invalid read of size 4
==6827==    at 0x805A7C6: write_u32 (portable_io.h:95)
==6827==    by 0x805A7C6: save_chunk_table (aft.c:402)
==6827==    by 0x805E035: save_afd (aft.c:616)
==6827==    by 0x805E035: open_and_update_audio_file (aft.c:1097)
==6827==    by 0x80589B5: open_next_audio_file (afs.c:425)
==6827==    by 0x80589B5: execute_server_command (afs.c:867)
==6827==    by 0x80589B5: command_post_select.part.3 (afs.c:921)
==6827==    by 0x80632CE: call_post_select (sched.c:80)
==6827==    by 0x80632CE: sched_post_select (sched.c:106)
==6827==    by 0x80632CE: schedule (sched.c:159)
==6827==    by 0x8059555: afs_init (afs.c:1006)
==6827==    by 0x804D53A: init_afs (server.c:528)
==6827==    by 0x804D53A: server_init (server.c:600)
==6827==    by 0x804D53A: main (server.c:689)
==6827==  Address 0x58c4a20 is 0 bytes after a block of size 40 alloc'd
==6827==    at 0x40345EE: malloc (vg_replace_malloc.c:299)
==6827==    by 0x80539C5: para_malloc (string.c:63)
==6827==    by 0x805B38A: load_chunk_table (aft.c:415)
==6827==    by 0x805DFC4: open_and_update_audio_file (aft.c:1087)
==6827==    by 0x80589B5: open_next_audio_file (afs.c:425)
==6827==    by 0x80589B5: execute_server_command (afs.c:867)
==6827==    by 0x80589B5: command_post_select.part.3 (afs.c:921)
==6827==    by 0x80632CE: call_post_select (sched.c:80)
==6827==    by 0x80632CE: sched_post_select (sched.c:106)
==6827==    by 0x80632CE: schedule (sched.c:159)
==6827==    by 0x8059555: afs_init (afs.c:1006)
==6827==    by 0x804D53A: init_afs (server.c:528)
==6827==    by 0x804D53A: server_init (server.c:600)
==6827==    by 0x804D53A: main (server.c:689)

5 years agoMerge branch 'refs/heads/t/mixer-fix'
Andre Noll [Sat, 23 Mar 2019 16:42:12 +0000 (17:42 +0100)]
Merge branch 'refs/heads/t/mixer-fix'

Two bug fixes for the sleep mode of para_mixer.  Started on 2018-07-07,
cooking since 2018-08-19.

* refs/heads/t/mixer-fix:
  mixer: sleep: Change to next file at fade-in time.
  mixer: sleep: Change to fade-in mood later.

5 years agoogg: Detect missing ogg pages.
Andre Noll [Sat, 22 Dec 2018 17:04:28 +0000 (18:04 +0100)]
ogg: Detect missing ogg pages.

If pages of an ogg file were cut out, for example with a command like

para_afh -r 'afh -b 100 -f foo.ogg'

the ogg audio format handler still reports the duration of the
full file. This commit makes it detect this case and adjust the
duration accordingly.

This affects all audio formats which employ the ogg container format.

5 years agobuild: Check also for CRYPTO_cleanup_all_ex_data.
Andre Noll [Fri, 21 Dec 2018 17:11:40 +0000 (18:11 +0100)]
build: Check also for CRYPTO_cleanup_all_ex_data.

FreeBSD 12 does not seem to have it. This is not fatal since omitting
the call to CRYPTO_cleanup_all_ex_data() just results in a harmless
memory leak at exit.

5 years agobuild: Detect openssl library/header mismatch.
Andre Noll [Fri, 21 Dec 2018 15:43:54 +0000 (16:43 +0100)]
build: Detect openssl library/header mismatch.

This catches the case where openssl-1.0 headers are used for compiling
but openssl-1.1 libraries for linking. Without the check that is added
by this commit the compilation succeeds in this case but the executable
segfaults on the attempt to modify the RSA structure directly. With
the new check, configure fails gracefully.

This happened on a FreeBSD system where the openssl-1.0 headers were
installed in /usr/local and  openssl-1.1 headers in /usr.

5 years agoFix i9e completion.
Andre Noll [Sat, 22 Dec 2018 21:28:37 +0000 (22:28 +0100)]
Fix i9e completion.

i9e_print_completions() does not work as intended when the cursor is
positioned right after a word. This patch should fix it.

5 years agomp3_afh: Move mode_text[] into header_mode().
Andre Noll [Sun, 30 Sep 2018 21:39:58 +0000 (23:39 +0200)]
mp3_afh: Move mode_text[] into header_mode().

The array is only used in header_mode(), so it should be local to
the function.  Also, it's confusing to let the last element play the
role of the invalid header mode, and it's clearer to use ARRAY_SIZE()
instead of spelling out the index of the last element. Next, it's
unnecessary to write to the mp3header structure, so avoid this and
mark the pointer argument const.  Finally, the patch makes the array
constant, not only the mode strings.

5 years agoAdd homepage link.
Andre Noll [Sat, 19 Jan 2019 23:13:17 +0000 (00:13 +0100)]
Add homepage link.

People who like this project might be interested in the other projects
of the author too..

5 years agoChange copyright year to 2019.
Andre Noll [Sun, 20 Jan 2019 10:50:12 +0000 (11:50 +0100)]
Change copyright year to 2019.

5 years agobuild: Remove hard-coded include path.
Andre Noll [Sat, 22 Dec 2018 13:54:24 +0000 (14:54 +0100)]
build: Remove hard-coded include path.

Compilers generally have /usr/local/include in their default search
path.  And if they don't, that has to be considered a local policy
which should not be ignored. The user can always override it by
setting CPPFLAGS.

5 years agobuild: Fix CPPFLAGS for openssl.
Andre Noll [Sat, 22 Dec 2018 13:00:14 +0000 (14:00 +0100)]
build: Fix CPPFLAGS for openssl.

The effect of the wrong file name was that --with-openssl-headers
was effectively ignored.

This bug was introduced one year ago in commit a4c2c4f9c7cd (crypt:
Rename RSA functions) which renamed the crypt.c file to openssl.c but
missed to adjust the Makefile accordingly.

5 years agostring.c: Fix typos in comment.
Andre Noll [Sun, 23 Dec 2018 21:37:31 +0000 (22:37 +0100)]
string.c: Fix typos in comment.

5 years agomixer: Trivial whitespace fix.
Andre Noll [Fri, 23 Nov 2018 19:28:45 +0000 (20:28 +0100)]
mixer: Trivial whitespace fix.

5 years agocom_select(): Improve message.
Andre Noll [Wed, 10 Oct 2018 18:12:28 +0000 (20:12 +0200)]
com_select(): Improve message.

Let's be gramatically correct and omit the plural "s" if there is
only one admissible file.

5 years agoerror.h: Clarify difference between para_errlist[] and DEFINE_PARA_ERRLIST.
Andre Noll [Sun, 30 Sep 2018 21:25:36 +0000 (23:25 +0200)]
error.h: Clarify difference between para_errlist[] and DEFINE_PARA_ERRLIST.

5 years agomixer.c: Fix doxygen \file description.
Andre Noll [Sun, 30 Sep 2018 21:15:39 +0000 (23:15 +0200)]
mixer.c: Fix doxygen \file description.

para_mixer supports the OSS and the ALSA mixer API.

5 years agovss: Add documentation of MAP_POPULATE.
Andre Noll [Sun, 30 Sep 2018 20:58:25 +0000 (22:58 +0200)]
vss: Add documentation of MAP_POPULATE.

It should be clear why the vss should ask the kernel to prefault the
page tables for the mapping, but it's less clear why we might need
to define the preprocessor symbol.

5 years agodoc: Silence doxygen warnings.
Andre Noll [Sun, 30 Sep 2018 20:51:23 +0000 (22:51 +0200)]
doc: Silence doxygen warnings.

This gets rid of many warnings of the form

warning: Member lyr_get_def_by_id(uint32_t id, struct osl_object *def) (function) of file afs.h is not documented.

which show up if EXTRACT_ALL is set to "no".