Clean up statistics display for backends with no sync. Flush pipe and stdout backends when play stops.

This commit is contained in:
Mike Brady
2020-05-24 09:45:03 +01:00
parent 5b24dddecd
commit 9280e1430b
3 changed files with 17 additions and 13 deletions
+4 -2
View File
@@ -86,8 +86,10 @@ static int play(void *buf, int samples) {
static void stop(void) {
// Don't close the pipe just because a play session has stopped.
// if (fd > 0)
// close(fd);
// Flush it instead
if (fd > 0)
if (fsync(fd) != 0)
debug(1, "Error flushing pipe when play stopped: \"%s\".", strerror(errno));
}
static int init(int argc, char **argv) {