ap

An audio player suited to my tastes
Log | Files | Refs | README | LICENSE

commit 85fa954d29f13d1c6a75822cdf86de461f8865bc
parent 3bfcaa97264f1bb6099d0df5bf4ae798a7dfbd65
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Thu, 26 Aug 2021 11:31:39 -0700

Move the timeout variable to the server struct

Diffstat:
Maps/aps.c | 5+++--
Maps/aps.h | 1+
Maps/config.h | 2--
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/aps/aps.c b/aps/aps.c @@ -28,7 +28,6 @@ #include "arg.h" #include "asplit.h" #include "command.h" -#include "config.h" #include "log.h" #include "queue.h" #include "util.h" @@ -60,6 +59,8 @@ aps_open(char *path, char **player) return NULL; } + aps->timeout = 250; + return aps; } @@ -145,7 +146,7 @@ aps_update(struct aps *aps) int i; int re; - if ((re = poll(aps->pfds, LEN(aps->pfds), timeout)) <= 0) + if ((re = poll(aps->pfds, LEN(aps->pfds), aps->timeout)) <= 0) return re; for (i = 0; re > 0 && i < LEN(aps->pfds); ++i) { diff --git a/aps/aps.h b/aps/aps.h @@ -22,6 +22,7 @@ struct aps { struct item *queue; struct command *coms; unsigned int ncoms; + unsigned int timeout; }; struct aps *aps_open(char *, char **); diff --git a/aps/config.h b/aps/config.h @@ -2,5 +2,3 @@ static char *player[] = { /* Carot replaced by item path */ "ffplay", "-loglevel", "error", "-nodisp", "-autoexit", "^", NULL }; - -static int timeout = 250;