]> git.tuebingen.mpg.de Git - paraslash.git/commit
mixer: sleep: Cycle audiod on stop.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 6 Mar 2022 20:05:09 +0000 (21:05 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 16 Oct 2022 16:53:33 +0000 (18:53 +0200)
commit149460f7ea29ce43cb3fe5795cf7395c57e13cba
treed99406aa1c1821c2cfb45742846c098ca821bc69
parentbe5daec66f163725489f42d512659a8af5c3fd59
mixer: sleep: Cycle audiod on stop.

This modifies the sleep command to turn off audiod before sending the
stop command to the server. This way the stream terminates immediately
(on the local machine) rather than when the input queue of the stream
has drained, which may be a several seconds later.

This is important because we are going to set the initial volume but
don't want to change the volume of the stream which is about to end.
Currently this is "solved" by sleeping one second, but this has always
been a hack that never worked well in practice.

In order to be able to send commands to para_audiod we introduce
audioc_cmd() which shares most of the implementation of client_cmd(),
so we make both functions wrappers for the new run() which works for both
command types.

To avoid code duplications we also introduce stop() which does the
equivalent of

para_audioc off
para_client stop
para_audioc on
mixer.c