commit 1daddf3b8e00af71f3363048bb804babf19b650d
parent 1c0b32b863701d81a49eb31bb4089dba1d5061c0
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Thu, 20 May 2021 19:20:07 -0700
Fix player
The pupdate function checked WIFEXITED but not WIFSIGNALED. They
are now treated the same.
Add -autoexit because ffplay(1) doesn't exit at the end of input
otherwise.
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -3,5 +3,5 @@ static char *address = "/tmp/aps";
static char *player[] = {
/* "" = path */
/* prog, arg, ... */
- "ffplay", "apsplayer", "-loglevel", "error", "-nodisp", "", NULL
+ "ffplay", "apsplayer", "-loglevel", "error", "-nodisp", "-autoexit", "", NULL
};
diff --git a/player.c b/player.c
@@ -111,7 +111,7 @@ ptoggle(struct player *p)
void
pupdate(struct player *p, int status)
{
- if (WIFEXITED(status)) {
+ if (WIFEXITED(status) || WIFSIGNALED(status)) {
if (p->state != STOPPED)
p->state = 0;
} else if (WIFCONTINUED(status)) {