]> git.tuebingen.mpg.de Git - paraslash.git/log
paraslash.git
8 hours agoMerge topic branch t/sched into pu pu
Andre Noll [Thu, 12 Jun 2025 23:17:36 +0000 (01:17 +0200)]
Merge topic branch t/sched into pu

Started on 2025-06-01

* refs/heads/t/sched:
  server: Kill global variable sched.
  Make struct sched private.

# Conflicts:
# sched.h

8 hours agoMerge topic branch t/misc into pu
Andre Noll [Thu, 12 Jun 2025 23:17:06 +0000 (01:17 +0200)]
Merge topic branch t/misc into pu

The stuff in here is too small to get its own topic branch. The
commits are generally regarded as safe enough to be applied directly to
"master" without cooking in "next" first. However, if a commit induces
a merge conflict or is important enough to get mentioned in an item
of the NEWS file, the commit should get a dedicated topic branch.

Unlike most other topic branches, this branch never promotes to
"next". When a set of commits is ready to graduate to "master", the
branch is rebased onto "master" and its commits are re-ordered so that
the graduating commits appear at the beginning. The last such commit
is merged to "master". This always results in a fast-forward merge,
so no merge message needs to be supplied.

<!-- No merge message -->

* refs/heads/t/misc:
  Move FOR_EACH_RECEIVER from recv.h to recv_common.c.
  send_common.c does not need afs.h.
  Speed up blob operations.
  vss: Make vss_next() and vss_repos() static.
  vss: Change vss_playing() and friends to return bool.
  wma: Use unsigned byte arrays.
  sched.h: Remove an unnecessary declaration.
  server: Delay vss shutdown in command handler context.

# Conflicts:
# sched.h

8 hours agoMerge topic branch t/doxygen into pu
Andre Noll [Thu, 12 Jun 2025 23:16:38 +0000 (01:16 +0200)]
Merge topic branch t/doxygen into pu

This revamps the doxygen part of the documentation web page, adding a couple
of entry points for users to get started with the code base. We provide links
to header files which descripe the API of central subsystems and links to
the main file of each paraslash executable.

The \file comment of the source files reachable through these links have been
extended to contain a detailed description of the API or executable. Unlike
the introductory text of the manual pages, these comments focus on the code,
particularly the interaction between the various subsystems.

This also reactivates the source browser, since it is actually quite useful
to quickly check for some detail.

<!--

- Major revamp of the source code documention and the documentation web page.

-->

* refs/heads/t/doxygen: (38 commits)
  crypt
  gui
  doc-page
  f
  filter api
  recv
  afs
  afs
  afs
  fec
  doc-site
  send.h
  senders
  send/source-browser
  write
  afh
  afh.h
  f
  afh
  Move detailed desc to top
  ...

# Conflicts:
# crypt.h

8 hours agoMove FOR_EACH_RECEIVER from recv.h to recv_common.c.
Andre Noll [Wed, 11 Jun 2025 19:04:48 +0000 (21:04 +0200)]
Move FOR_EACH_RECEIVER from recv.h to recv_common.c.

It called twice from there but from nowhere else.

8 hours agosend_common.c does not need afs.h.
Andre Noll [Wed, 11 Jun 2025 17:12:15 +0000 (19:12 +0200)]
send_common.c does not need afs.h.

Fixes: 2abba90245f87fab096edfc3faf7df61646b713f
8 hours agoSpeed up blob operations.
Andre Noll [Sun, 11 May 2025 20:07:27 +0000 (22:07 +0200)]
Speed up blob operations.

The current status items are unaffected by any blob operations, so this code
is completely unnecessary.

8 hours agovss: Make vss_next() and vss_repos() static.
Andre Noll [Sun, 8 Jun 2025 21:18:22 +0000 (23:18 +0200)]
vss: Make vss_next() and vss_repos() static.

Unlike vss_playing(), vss_paused() and vss_stopped(), these are only called
from within vss.c.

8 hours agovss: Change vss_playing() and friends to return bool.
Andre Noll [Sun, 8 Jun 2025 21:12:23 +0000 (23:12 +0200)]
vss: Change vss_playing() and friends to return bool.

All users are in boolean contexts.

8 hours agowma: Use unsigned byte arrays.
Andre Noll [Mon, 2 Jun 2025 20:08:10 +0000 (22:08 +0200)]
wma: Use unsigned byte arrays.

They get initialized with values which cause an overflow on systems where
char is signed.

8 hours agosched.h: Remove an unnecessary declaration.
Andre Noll [Mon, 2 Jun 2025 22:58:25 +0000 (00:58 +0200)]
sched.h: Remove an unnecessary declaration.

8 hours agoserver: Delay vss shutdown in command handler context.
Andre Noll [Mon, 9 Jun 2025 19:23:59 +0000 (21:23 +0200)]
server: Delay vss shutdown in command handler context.

The sender status subcommand invoked via ->handle_connect() accesses memory
that has been freed in vss_shutdown(), resulting in garbage output. This
use-after-free bug is correctly reported by valgrind. It can easily be fixed
by moving the vss_shutdown() call down.

Fixes: 018a7b7927b76044b28eece39039cb2f5ea9c192
8 hours agocrypt
Andre Noll [Thu, 12 Jun 2025 23:03:26 +0000 (01:03 +0200)]
crypt

10 hours agogui
Andre Noll [Thu, 12 Jun 2025 21:41:19 +0000 (23:41 +0200)]
gui

10 hours agodoc-page
Andre Noll [Thu, 12 Jun 2025 20:47:50 +0000 (22:47 +0200)]
doc-page

12 hours agof
Andre Noll [Thu, 12 Jun 2025 19:24:36 +0000 (21:24 +0200)]
f

12 hours agofilter api
Andre Noll [Thu, 12 Jun 2025 19:18:46 +0000 (21:18 +0200)]
filter api

36 hours agorecv
Andre Noll [Wed, 11 Jun 2025 19:03:27 +0000 (21:03 +0200)]
recv

37 hours agoafs
Andre Noll [Wed, 11 Jun 2025 17:54:18 +0000 (19:54 +0200)]
afs

38 hours agoafs
Andre Noll [Wed, 11 Jun 2025 17:22:34 +0000 (19:22 +0200)]
afs

38 hours agoafs
Andre Noll [Wed, 11 Jun 2025 17:11:52 +0000 (19:11 +0200)]
afs

40 hours agoserver: Kill global variable sched.
Andre Noll [Mon, 2 Jun 2025 18:10:54 +0000 (20:10 +0200)]
server: Kill global variable sched.

Make it local to main() and pass the pointer to the few functions that need it.

40 hours agoMake struct sched private.
Andre Noll [Tue, 10 Jun 2025 14:06:03 +0000 (16:06 +0200)]
Make struct sched private.

This moves the declaration of the structure from sched.h to sched.c because
the information stored in this structure has almost no users outside of the
scheduler core.

As a result, the size of the structure is no longer known outside of sched.c.
Applications now must call the new sched_new() to obtain a pointer to an
initialized scheduler structure, passing an alternative poll function if
needed. We don't let applications set the default timeout anymore because
the value is kind of arbitrary anyway and most applications simply specified
one second. So hardcode this as the default.

41 hours agofec
Andre Noll [Wed, 11 Jun 2025 14:02:25 +0000 (16:02 +0200)]
fec

42 hours agodoc-site
Andre Noll [Wed, 11 Jun 2025 13:04:34 +0000 (15:04 +0200)]
doc-site

2 days agoMerge branch 'master' into next next
Andre Noll [Tue, 10 Jun 2025 14:09:17 +0000 (16:09 +0200)]
Merge branch 'master' into next

* master:
  i9e: Constify completer arrays.
  Prefer __func__ to __FUNCTION__.
  imdct: Kill fftsample_t typedef.
  Doxgen: Do not omit brief descriptions.
  fd: Modify xwrite() and write_all() to take void * buffer argument.

# Conflicts:
# interactive.h

2 days agosend.h
Andre Noll [Mon, 9 Jun 2025 21:38:50 +0000 (23:38 +0200)]
send.h

2 days agosenders
Andre Noll [Mon, 9 Jun 2025 18:59:03 +0000 (20:59 +0200)]
senders

2 days agosend/source-browser
Andre Noll [Mon, 9 Jun 2025 18:48:39 +0000 (20:48 +0200)]
send/source-browser

2 days agowrite
Andre Noll [Mon, 9 Jun 2025 15:39:01 +0000 (17:39 +0200)]
write

2 days agoafh
Andre Noll [Sun, 8 Jun 2025 21:09:46 +0000 (23:09 +0200)]
afh

2 days agoafh.h
Andre Noll [Sun, 8 Jun 2025 19:54:40 +0000 (21:54 +0200)]
afh.h

2 days agof
Andre Noll [Sun, 8 Jun 2025 18:05:21 +0000 (20:05 +0200)]
f

2 days agoafh
Andre Noll [Sun, 8 Jun 2025 17:59:08 +0000 (19:59 +0200)]
afh

2 days agoMove detailed desc to top
Andre Noll [Wed, 4 Jun 2025 19:59:18 +0000 (21:59 +0200)]
Move detailed desc to top

2 days agolayout
Andre Noll [Wed, 4 Jun 2025 19:56:59 +0000 (21:56 +0200)]
layout

2 days ago.
Andre Noll [Wed, 4 Jun 2025 19:54:29 +0000 (21:54 +0200)]
.

2 days ago.
Andre Noll [Wed, 4 Jun 2025 17:57:16 +0000 (19:57 +0200)]
.

2 days ago.
Andre Noll [Mon, 2 Jun 2025 22:57:25 +0000 (00:57 +0200)]
.

2 days ago.
Andre Noll [Mon, 2 Jun 2025 22:35:37 +0000 (00:35 +0200)]
.

2 days ago.
Andre Noll [Sun, 1 Jun 2025 15:26:41 +0000 (17:26 +0200)]
.

2 days ago.
Andre Noll [Sun, 1 Jun 2025 01:36:59 +0000 (03:36 +0200)]
.

2 days ago.
Andre Noll [Sat, 31 May 2025 22:19:15 +0000 (00:19 +0200)]
.

2 days agodox
Andre Noll [Sat, 31 May 2025 19:02:19 +0000 (21:02 +0200)]
dox

2 days agodox
Andre Noll [Wed, 28 May 2025 17:55:46 +0000 (19:55 +0200)]
dox

2 days agorecv.c: Do not include fd.h
Andre Noll [Wed, 28 May 2025 17:36:08 +0000 (19:36 +0200)]
recv.c: Do not include fd.h

2 days agodoxygen
Andre Noll [Wed, 28 May 2025 00:24:09 +0000 (02:24 +0200)]
doxygen

2 days agodox
Andre Noll [Tue, 27 May 2025 23:09:28 +0000 (01:09 +0200)]
dox

2 days agodoxygen
Andre Noll [Tue, 27 May 2025 22:06:58 +0000 (00:06 +0200)]
doxygen

2 days agoRevamp documentation of filter.c
Andre Noll [Tue, 27 May 2025 20:16:04 +0000 (22:16 +0200)]
Revamp documentation of filter.c

2 days agodoxygen: Hide undocumented members.
Andre Noll [Mon, 26 May 2025 21:11:14 +0000 (23:11 +0200)]
doxygen: Hide undocumented members.

2 days agocss: Remove a lot of unused cruft.
Andre Noll [Mon, 26 May 2025 13:55:44 +0000 (15:55 +0200)]
css: Remove a lot of unused cruft.

None of these are actually used in the pages generated by doxyen-1.8.

2 days agodoxygen: Use a more sane default output directory.
Andre Noll [Mon, 26 May 2025 20:45:21 +0000 (22:45 +0200)]
doxygen: Use a more sane default output directory.

Put the pages below build/ so that make distclean removes them.

2 days agoi9e: Constify completer arrays. master
Andre Noll [Mon, 2 Jun 2025 21:25:47 +0000 (23:25 +0200)]
i9e: Constify completer arrays.

This way the array of completers goes into the rodata section.

2 days agoPrefer __func__ to __FUNCTION__.
Andre Noll [Mon, 2 Jun 2025 20:48:41 +0000 (22:48 +0200)]
Prefer __func__ to __FUNCTION__.

The former is part of the C99 standard, while the latter is only provided
for backward compatibility. This change also silences many gcc warnings when
compiling with -Wpendantic (disabled in the default build).

2 days agoimdct: Kill fftsample_t typedef.
Andre Noll [Mon, 2 Jun 2025 19:45:34 +0000 (21:45 +0200)]
imdct: Kill fftsample_t typedef.

There is no advantage in not using plain float here.

2 days agoDoxgen: Do not omit brief descriptions.
Andre Noll [Mon, 2 Jun 2025 22:36:31 +0000 (00:36 +0200)]
Doxgen: Do not omit brief descriptions.

Commit 3107d2411a7a was a bit overzealous because with BRIEF_MEMBER_DESC
and REPEAT_BRIEF both set to NO the short text does not even make it into
the detailed description. This was unintended, so partially revert this change.

Fixes: 3107d2411a7a8f4085d0db65851483f2cb3c4f6e
8 days agofd: Modify xwrite() and write_all() to take void * buffer argument.
Andre Noll [Mon, 2 Jun 2025 21:34:21 +0000 (23:34 +0200)]
fd: Modify xwrite() and write_all() to take void * buffer argument.

That's what the underlying call to writev(2) expects.

10 days agoMerge branch 'master' into next
Andre Noll [Mon, 2 Jun 2025 19:44:05 +0000 (21:44 +0200)]
Merge branch 'master' into next

* master:
  net.c: Convert SS_IS_ADDR_V4MAPPED() to lower case.

10 days agoMerge topic branch t/wmadec into master
Andre Noll [Mon, 2 Jun 2025 19:42:21 +0000 (21:42 +0200)]
Merge topic branch t/wmadec into master

A few patches which remove unused code from the wma decoder and audio
format handler. Notably, noise coding was removed completely since
it was only used for unusual bit rates. Most likely, it never worked
in the first place.

* refs/heads/t/wmadec:
  wmadec: Fix typo in comment.
  wmadec: Remove a stale comment in wma_init().
  wmadec: Kill pointless start/end computations.
  wmadec: Remove noise coding.
  wmadec: Simplify wma_init().
  wmadec: Remove fft().

10 days agonet.c: Convert SS_IS_ADDR_V4MAPPED() to lower case.
Andre Noll [Sat, 31 May 2025 17:30:31 +0000 (19:30 +0200)]
net.c: Convert SS_IS_ADDR_V4MAPPED() to lower case.

It's not a macro, after all. Remove the superfluous braces and fix
a whitespace issue while at it.

13 days agoMerge branch 'master' into next
Andre Noll [Fri, 30 May 2025 11:24:40 +0000 (13:24 +0200)]
Merge branch 'master' into next

* master:
  Shrink struct rmatt_event_data.
  filter.c: Constify dummy variable.
  filter.c: Remove unused status_item_list[].
  audiod.c: Make slots[] static.
  server.c: Remove unused server_get_tasks().

2 weeks agoShrink struct rmatt_event_data.
Andre Noll [Mon, 26 May 2025 18:38:37 +0000 (20:38 +0200)]
Shrink struct rmatt_event_data.

The aft event handler needs to know the bit number of the attribute which is
being removed in order to clear the bit in the afs info structure of each row
of the audio file table. The handler does not need to know the attribute's
name, though, and remove_attribute() already prints it, so remove this field
from the event data structure.

2 weeks agofilter.c: Constify dummy variable.
Andre Noll [Tue, 27 May 2025 19:19:30 +0000 (21:19 +0200)]
filter.c: Constify dummy variable.

It needs to be non-static, but it may be const because the amp filter
only reads the values of this array.

2 weeks agofilter.c: Remove unused status_item_list[].
Andre Noll [Tue, 27 May 2025 19:15:51 +0000 (21:15 +0200)]
filter.c: Remove unused status_item_list[].

para_filter does not need this at all, and never has, afaict.

2 weeks agoaudiod.c: Make slots[] static.
Andre Noll [Tue, 27 May 2025 23:28:02 +0000 (01:28 +0200)]
audiod.c: Make slots[] static.

It's only used in audiod.c.

2 weeks agoserver.c: Remove unused server_get_tasks().
Andre Noll [Tue, 27 May 2025 21:51:40 +0000 (23:51 +0200)]
server.c: Remove unused server_get_tasks().

The last caller was removed when the tasks server subcommand was disabled
eight years ago.

Fixes: bb91597b9ecf650a63a40753f7f7c771576d252e
2 weeks agoMerge branch 'master' into next
Andre Noll [Mon, 26 May 2025 16:02:20 +0000 (18:02 +0200)]
Merge branch 'master' into next

* master:
  css: Remove memItem tweaks.
  css: Fix a typo in comment.
  fec.c: Remove an unused #include.
  Move public key to web/.
  INSTALL: Remove installation instructions of lopsub.
  http sender: Kill pointless macro.

2 weeks agoMerge topic branch t/select- into master
Andre Noll [Mon, 26 May 2025 16:00:34 +0000 (18:00 +0200)]
Merge topic branch t/select- into master

A single patch which implements the new "select -" feature to switch
back to the previous mood or playlist.

* refs/heads/t/select-:
  com_select(): Support '-' to reactivate the previous mood/playlist.

2 weeks agocss: Remove memItem tweaks.
Andre Noll [Sun, 25 May 2025 20:35:27 +0000 (22:35 +0200)]
css: Remove memItem tweaks.

The pages look better without this since the tables no longer contain
horizontal lines above all entities.

2 weeks agocss: Fix a typo in comment.
Andre Noll [Sun, 25 May 2025 17:56:47 +0000 (19:56 +0200)]
css: Fix a typo in comment.

2 weeks agofec.c: Remove an unused #include.
Andre Noll [Sun, 25 May 2025 17:45:58 +0000 (19:45 +0200)]
fec.c: Remove an unused #include.

The fec code does not need the helpers from portable_io.h.

2 weeks agoMove public key to web/.
Andre Noll [Sun, 25 May 2025 17:33:36 +0000 (19:33 +0200)]
Move public key to web/.

It's only needed for the web pages, so it should not be contained in the
top-level directory.

2 weeks agoINSTALL: Remove installation instructions of lopsub.
Andre Noll [Sun, 25 May 2025 17:29:57 +0000 (19:29 +0200)]
INSTALL: Remove installation instructions of lopsub.

These days, people should just install the Debian package. If lopsub is not
installed, the configure script prints detailed instructions about how to
obtain lopsub with and without apt.

2 weeks agohttp sender: Kill pointless macro.
Andre Noll [Sun, 25 May 2025 17:18:42 +0000 (19:18 +0200)]
http sender: Kill pointless macro.

The code is shorter and easier to read without the macro.

2 weeks agoMerge branch 'master' into next
Andre Noll [Sun, 25 May 2025 17:11:17 +0000 (19:11 +0200)]
Merge branch 'master' into next

* master:
  Introduce VSS_NEW_AUDIO_FILE to fix playlist updates.

2 weeks agoIntroduce VSS_NEW_AUDIO_FILE to fix playlist updates.
Andre Noll [Wed, 19 Mar 2025 21:05:16 +0000 (22:05 +0100)]
Introduce VSS_NEW_AUDIO_FILE to fix playlist updates.

The playlist event handler handles afsi change events by moving the affected
entry to the end of the playlist. This is the right thing to do if the
event was triggered by virtual streaming system streaming a new file. It is
incorrect, however, if the event was triggered by a subcommand such as touch.

This commit introduces the new afs event type VSS_NEW_AUDIO_FILE to distinguish
between the two different use cases. The audio file table event handler
ignores the VSS_NEW_AUDIO_FILE event while the playlist event handler ignores
the AFSI_CHANGE event. The moods event handler treats both events equally,

Get rid of a pointless static one-liner function in playlist.c while at it.

2 weeks agoMerge topic branch t/wmadec into next
Andre Noll [Sat, 24 May 2025 17:41:41 +0000 (19:41 +0200)]
Merge topic branch t/wmadec into next

Started on 2025-01-22

A few patches which remove unused code from the wma decoder and audio
format handler. Notably, noise coding was removed completely since
it was only used for unusual bit rates. Most likely, it never worked
in the first place.

* refs/heads/t/wmadec:
  wmadec: Fix typo in comment.
  wmadec: Remove a stale comment in wma_init().
  wmadec: Kill pointless start/end computations.

2 weeks agoMerge topic branch t/deprecate_setatt into next
Andre Noll [Sat, 24 May 2025 17:41:33 +0000 (19:41 +0200)]
Merge topic branch t/deprecate_setatt into next

A single patch which deprecates the setatt server subcommand. This subcommand
fails, for example, if the name of an audio file happens to end in '+'
or '-'. The replacement for setatt are the two new options to the touch
subcommand to set or unset attributes.

* refs/heads/t/deprecate_setatt:
  server: Deprecate setatt in favor of touch.

2 weeks agoMerge branch 'master' into next
Andre Noll [Sat, 24 May 2025 17:41:30 +0000 (19:41 +0200)]
Merge branch 'master' into next

* master:
  aft: Pass correct afsi argument to AFSI_CHANGE event handlers.

3 weeks agoMerge topic branch t/rm_sha1 into next
Andre Noll [Thu, 22 May 2025 17:13:09 +0000 (19:13 +0200)]
Merge topic branch t/rm_sha1 into next

The series first drops the para_upgrade_db executable because it is no longer
needed. This removes the penultimate user of the sha1 infrastructure. The
remaining user is the handshake between para_client and para_server.

Since paraslash-0.7.0, client and server employ sha256 by default, but fall
back to sha1 in order to stay compatible to old 0.6.x versions. This series
instructs server and client to always employ sha256 as the hash algorithm,
breaking compatibility with 0.6.x clients. As a result, the sha1 hash algorithm
is no longer used anywhere, so the corresponding infrastructure is no longer
needed. This gets rid of a fair amount of code.

<!--

- The para_upgrade_db executable to convert old paraslash databases has
been removed. paraslash-0.7.0 was released more than three years ago, so
everybody should have upgraded by now.

- Authentication now rejects the weak sha1 hash algorithm, breaking
compatibility with 0.6.x versions. Older 0.7.x clients are still compatible
to current server versions and current clients can still talk to servers
running older 0.7.x versions.

-->

* refs/heads/t/rm_sha1:
  Rename hash2 -> hash.
  Remove sha1.
  Remove para_upgrade_db.
  aft: Compare the full hash, not just the first 20 bytes.

3 weeks agoRename hash2 -> hash.
Andre Noll [Sun, 18 May 2025 18:31:33 +0000 (20:31 +0200)]
Rename hash2 -> hash.

Now that sha1 is no longer supported, the hash2 naming has become meaningless.
Rename it back to "hash".

3 weeks agoRemove sha1.
Andre Noll [Sun, 18 May 2025 18:17:12 +0000 (20:17 +0200)]
Remove sha1.

Server and client prefer sha256 in the authentication protocol since
paraslash-0.7.0, while 0.6.x clients and servers only know about sha1. This
patch drops the compatibility code which enabled old clients to connect to
new servers and vice versa.

Now the client code no longer checks whether the sha256 feature is supported,
but requests and uses the feature unconditionally. The server still announces
the sha256 feature and accepts the corresponding feature request, but uses
sha256 unconditionally.

With this approach older 0.7.x clients are still compatible to current
server versions and current clients can still talk to servers running older
0.7.x versions.

3 weeks agoMerge branch 'master' into next
Andre Noll [Thu, 22 May 2025 16:47:09 +0000 (18:47 +0200)]
Merge branch 'master' into next

* master:
  Improve documentation of set_max_chunk_size().
  Warn about old (0.5.x or earlier) on-disk afhi.
  doxyen: Completely suppress brief descriptions.
  buffer_tree: Assert that we don't pass NULL to memcpy().
  mp.c: Remove a dead store.
  mood.c: Remove a dead store and fix the documentation of mood_load().
  flac_afh: Check for possible integer overflows.
  gcc-compat.h: Drop inline #define.

3 weeks agoRemove para_upgrade_db.
Andre Noll [Mon, 19 May 2025 20:01:36 +0000 (22:01 +0200)]
Remove para_upgrade_db.

It is no longer needed since everybody should have upgraded by now, and it
blocks the road towards the removal of sha1.

3 weeks agoaft: Compare the full hash, not just the first 20 bytes.
Andre Noll [Sun, 18 May 2025 18:12:24 +0000 (20:12 +0200)]
aft: Compare the full hash, not just the first 20 bytes.

In 0.7.0 the hash algorithm for the hash column of the audio file table
changed from the 20 byte sha1 to the 32 byte sha256. However, the audio file
selector kept calling hash_compare() as the comparator, which looks only at
the first 20 bytes of the buffers passed.

This omission is clearly a bug, but given that we still accept old clients
which only know about sha1, it's benign because the truncated sha256 should
not be worse than sha1. Fix the bug anyway.

Fixes: 126b950f1bd70d1e5c200bc4157bbbb2798fc838
3 weeks agoaft: Pass correct afsi argument to AFSI_CHANGE event handlers.
Andre Noll [Wed, 14 May 2025 22:27:47 +0000 (00:27 +0200)]
aft: Pass correct afsi argument to AFSI_CHANGE event handlers.

Each time a new audio file is opened for streaming, we update the numplayed
and lastplayed fields of its afs info entry of the audio file table, then
update the global afsi and ahfi structures, then trigger an AFSI_CHANGE event,
which calls all table event handlers. The event handlers receive as arguments
a pointer to the old afsi and a pointer to the already modified aft row.

The AFSI_CHANGE event handler of the audio file table gets called in the
situation described above, and also via the touch and cpsi subcommands,
because these also change the afsi info structure and therefore trigger
AFSI_CHANGE events as well. The handler checks whether the affected audio
file is the current audio file, and if it is, extracts the modified afsi
from the audio file table into the global afsi structure.

The problem is that in case of the above "next audio file" scenario, the
old afsi pointer points to the global afsi structure, which gets updated
by the aft event handler. Therefore the event handlers which happen to run
after the event handler of the audio file table see the already updated afsi
through the old_afsi pointer.

Since the audio file table happens to be the first table of the 7-element
afs_tables[] array iterated by afs_event(), all six other event handlers see
the incorrect afsi. However, only the moods event handler looks at the old afsi
to update the mean and quadratic variation of the lastplayed and numplayed
values of the afs statistics. Due to the bug described above, the old and
new lastplayed and numplayed values coincide, and therefore the statistics
update is a no-op. In practice, at least for moods with many admissible files,
the values will only be slightly off, so the bug is rather benign.

Fix this by renaming the on-stack new_afsi to old_afsi, adjusting
initializations accordingly, and passing a pointer to this instance instead.

3 weeks agoImprove documentation of set_max_chunk_size().
Andre Noll [Wed, 21 May 2025 18:36:52 +0000 (20:36 +0200)]
Improve documentation of set_max_chunk_size().

The old text implied that the function could be removed at some point, which
is not the case. Remove this part of the documentation and clarify what the
function actually does.

3 weeks agoWarn about old (0.5.x or earlier) on-disk afhi.
Andre Noll [Wed, 21 May 2025 18:23:23 +0000 (20:23 +0200)]
Warn about old (0.5.x or earlier) on-disk afhi.

Nine years ago, starting with commit 234647bb5, old on-disk entries are
reported with a notice to re-add the file in order to update the audio file
table. Bump the loglevel for now, and add a comment to turn the check into
a hard error eventually.

3 weeks agodoxyen: Completely suppress brief descriptions.
Andre Noll [Wed, 21 May 2025 18:03:54 +0000 (20:03 +0200)]
doxyen: Completely suppress brief descriptions.

This shortens the doxygen pages, removing lots of pointless duplications.

3 weeks agobuffer_tree: Assert that we don't pass NULL to memcpy().
Andre Noll [Tue, 20 May 2025 20:47:46 +0000 (22:47 +0200)]
buffer_tree: Assert that we don't pass NULL to memcpy().

The buffer pointer cannot be NULL here because this only happens when the
buffer tree area is full, which is not the case thanks to the previous n <=
btr_pool_unused(btrp) check.

3 weeks agomp.c: Remove a dead store.
Andre Noll [Tue, 20 May 2025 20:13:54 +0000 (22:13 +0200)]
mp.c: Remove a dead store.

Found by the clang analyzer.

3 weeks agowmadec: Fix typo in comment.
Andre Noll [Wed, 21 May 2025 19:38:26 +0000 (21:38 +0200)]
wmadec: Fix typo in comment.

3 weeks agowmadec: Remove a stale comment in wma_init().
Andre Noll [Wed, 21 May 2025 19:03:02 +0000 (21:03 +0200)]
wmadec: Remove a stale comment in wma_init().

Noise coding has been removed.

Fixes: 9fe8a674535a00c6011f86b4ece3344200d00aa2
3 weeks agoMerge branch 'master' into next
Andre Noll [Wed, 21 May 2025 16:42:53 +0000 (18:42 +0200)]
Merge branch 'master' into next

* master:
  play.c: Kill pointless typedef.
  afs.h: Omit superfluous semicolons.
  Makefile: Drop redundant -Wuninitialized.

3 weeks agomood.c: Remove a dead store and fix the documentation of mood_load().
Andre Noll [Tue, 20 May 2025 20:10:31 +0000 (22:10 +0200)]
mood.c: Remove a dead store and fix the documentation of mood_load().

The function returns 1 on success, not the number of admissible files.

Found by the clang analyzer.

3 weeks agoflac_afh: Check for possible integer overflows.
Andre Noll [Tue, 20 May 2025 18:56:36 +0000 (20:56 +0200)]
flac_afh: Check for possible integer overflows.

This is a callback function which should carefully check its inputs.

3 weeks agogcc-compat.h: Drop inline #define.
Andre Noll [Tue, 20 May 2025 18:00:50 +0000 (20:00 +0200)]
gcc-compat.h: Drop inline #define.

There is no reason to believe that the programmer does a better job than
the compiler here.

3 weeks agowmadec: Kill pointless start/end computations.
Andre Noll [Tue, 20 May 2025 20:58:13 +0000 (22:58 +0200)]
wmadec: Kill pointless start/end computations.

Neither start nor end are used. The loop simply adds up the entries of one
line of the exponent_bands matrix.

Found by the clang analyzer.

3 weeks agoplay.c: Kill pointless typedef.
Andre Noll [Sun, 18 May 2025 19:40:31 +0000 (21:40 +0200)]
play.c: Kill pointless typedef.

The signature of the function pointer is too simple to warrant a typedef.

3 weeks agoafs.h: Omit superfluous semicolons.
Andre Noll [Sun, 18 May 2025 20:42:00 +0000 (22:42 +0200)]
afs.h: Omit superfluous semicolons.

The DECLARE_BLOB_SYMBOLS macro expands to a bunch of declarations, each of
which is terminated by a semicolon. So don't add another one.