commit c6ed484905c1deb5a9aaca164b7b21c14dbdedd9
parent e6262e9936dbe1184537d208acaaffbf48e7e7d5
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Sat, 29 May 2021 01:44:15 -0700
Fix player trying to play without a path
This bug was generally seen when using aps_toggle before a aps_seek.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/player.c b/player.c
@@ -84,7 +84,10 @@ pcontinue(struct player *p)
int
pplay(struct player *p, char *path)
{
- if (path && strcmp(p->path, path) != 0) {
+ if (path == NULL && !*p->path) {
+ errno = ENOENT;
+ return 1;
+ } else if (path && strcmp(p->path, path) != 0) {
if (p->state & (RUNNING | SUSPENDED) && pstop(p))
return 1;
if (strlcpy(p->path, path, sizeof(p->path)) >= sizeof(p->path))