shithub: pplay

Download patch

ref: cce425ce83e5c4b1dece0e2c10113cda716e2647
parent: 85be368ed57da2a6f3761f158d77222b27d70420
author: qwx <qwx@sciops.net>
date: Mon Oct 24 03:02:43 EDT 2022

don't die on me yet

--- a/pplay.c
+++ b/pplay.c
@@ -62,8 +62,11 @@
 	static int play;
 
 	if(play ^= 1){
-		if((afd = cat ? 1 : open("/dev/audio", OWRITE)) < 0)
-			sysfatal("open: %r");
+		if((afd = cat ? 1 : open("/dev/audio", OWRITE)) < 0){
+			fprint(2, "toggleplay: %r\n");
+			play = 0;
+			return;
+		}
 		if(threadcreate(athread, nil, mainstacksize) < 0)
 			sysfatal("threadcreate: %r");
 	}else{