]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'refs/heads/t/mixer'
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 15 Mar 2020 14:51:20 +0000 (15:51 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 15 Mar 2020 14:56:36 +0000 (15:56 +0100)
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.

1  2 
NEWS.md
mixer.c

diff --cc NEWS.md
index 3775b21c27e32426a11dd47758182ffd99bfeeff,55ef3be947ee76d6b0937b33988b0cd960c0e985..15496bd274a64b8127ae16c47fc90d7ea3140d4c
+++ b/NEWS.md
@@@ -1,31 -1,6 +1,32 @@@
  NEWS
  ====
  
 +----------------------------------------------
 +0.6.3 (to be announced) "generalized activity"
 +----------------------------------------------
 +
 +- The ff command now accepts a negative argument to instruct the
 +  virtual streaming system to jump backwards in the current audio
 +  stream. The old syntax (e.g., "ff 30-") is still supported but it
 +  is deprecated and no longer documented. The compatibility code is
 +  sheduled for removal after 0.7.0.
 +- para_afh: New option: --preserve to reset the modification time to
 +  the value of the original file after meta data modification.
 +- Overhaul of the compress filter code. The refined algorithm should
 +  reduce clipping. The meaning of --aggressiveness has changed, see the
 +  updated and extended documentation of the compress filter for details.
 +- Cleanup of the audio format handler code.
 +- We now build the tree using the .ONESHELL feature of GNU make,
 +  which results in a significant speedup.
 +- Two robustness fixes for FreeBSD.
 +- para_client now supports RFC4716 private keys as generated with
 +  ssh-keygen -m RFC4716. In fact, this key format has been made the
 +  default, and the former PEM keys will be depreciated at some point.
 +- The ogg audio format handlers learned to detect holes and now report
 +  the correct duration also if ogg pages are missing in the file. This
 +  affects ogg/vorbis ogg/speex and ogg/opus.
++- Robustness improvements for para_mixer.
 +
  --------------------------------------
  0.6.2 (2018-06-30) "elastic diversity"
  --------------------------------------
diff --cc mixer.c
index b14bb76ebe150864ae261da3c668c0be885e2f74,55282e77b6b3093e88f9bc66514d684956653e31..eae8929164770053c5c18843f4cf4e4e8bc5e616
+++ b/mixer.c
@@@ -288,10 -318,10 +318,10 @@@ static int com_sleep(const struct mixe
        PARA_INFO_LOG("waketime: %d:%02d\n", tm->tm_hour, tm->tm_min);
        client_cmd("stop");
        sleep(1);
 -      if (fot && fo_mood) {
 +      if (fot && fo_mood && *fo_mood) {
                ret = set_initial_volume(m, h);
                if (ret < 0)
-                       return ret;
+                       goto close_mixer;
                change_afs_mode(fo_mood);
                client_cmd("play");
                ret = set_channel(m, h, OPT_STRING_VAL(PARA_MIXER, MIXER_CHANNEL));
        } else {
                ret = m->set(h, fov);
                if (ret < 0)
-                       return ret;
+                       goto close_mixer;
        }
 -      if (sleep_mood) {
 +      if (sleep_mood && *sleep_mood) {
                change_afs_mode(sleep_mood);
                if (!fot || !fo_mood) /* currently stopped */
                        client_cmd("play");
 -      } else if (fot && fo_mood) /* currently playing */
 +      } else if (fot && fo_mood && *fo_mood) /* currently playing */
                client_cmd("stop");
 -      if (!fit || !fi_mood) /* nothing to do */
+       m->close(&h);
 +      if (!fit || !fi_mood || !*fi_mood) /* nothing to do */
                return 1;
        for (;;) {
                time(&t1);