shithub: riscv

Download patch

ref: 8ac28a3e2102332c64a12ae4b1424cc6501ef73e
parent: e18da032f0b875e86d66f728cb0007840d1fbc79
author: Sigrid <[email protected]>
date: Fri May 28 09:02:58 EDT 2021

zuke: treat toggle as play in stopped state

--- a/sys/src/cmd/audio/zuke/zuke.c
+++ b/sys/src/cmd/audio/zuke/zuke.c
@@ -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 '?':