ap

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

commit 859e17795956ea19742cff99450c135b9422aef7
parent 6ea072a27525d29417b72e50370fd9b21f28a619
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Thu, 20 May 2021 15:38:07 -0700

Fix player update function

If the player exited the state would be set to zero. This overwrote
the state set earlier by pstop and caused the next file to be played
in the main loop.

Diffstat:
Mplayer.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/player.c b/player.c @@ -113,10 +113,12 @@ ptoggle(struct player *p) void pupdate(struct player *p, int status) { - if (WIFEXITED(status)) - p->state = 0; - else if (WIFCONTINUED(status)) + if (WIFEXITED(status)) { + if (p->state != STOPPED) + p->state = 0; + } else if (WIFCONTINUED(status)) { p->state = RUNNING; - else if (WIFSTOPPED(status)) + } else if (WIFSTOPPED(status)) { p->state = SUSPENDED; + } }