shithub: plan9front

Download patch

ref: 8ac28a3e2102332c64a12ae4b1424cc6501ef73e
parent: e18da032f0b875e86d66f728cb0007840d1fbc79
author: Sigrid <ftrvxmtrx@gmail.com>
date: Fri May 28 07:02:58 EDT 2021

zuke: treat toggle as play in stopped state

--- a/sys/src/cmd/audio/zuke/zuke.c	Thu May 27 01:47:10 2021
+++ b/sys/src/cmd/audio/zuke/zuke.c	Fri May 28 07:02:58 2021
@@ -724,11 +724,10 @@
 	threadexits(nil);
 }
 
-static void
+static int
 toggle(Player *player)
 {
-	if(player != nil)
-		sendul(player->ctl, Ctoggle);
+	return (player != nil && sendul(player->ctl, Ctoggle) == 1) ? 0 : -1;
 }
 
 static void
@@ -1328,7 +1327,8 @@
 			case 'c':
 			case 'p':
 			case ' ':
-				toggle(playercurr);
+				if(toggle(playercurr) != 0)
+					goto playcur;
 				break;
 			case '/':
 			case '?':