shithub: riscv

Download patch

ref: f6a6ccb1d56c0f6cf3677b6d7f31da0c8c362510
parent: c7c5ed3571d5d2c8e2c34d5c93cab9951b9e940a
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Feb 19 13:00:22 EST 2024

libtags/wav: process unknown tags as well

--- a/sys/src/cmd/audio/libtags/wav.c
+++ b/sys/src/cmd/audio/libtags/wav.c
@@ -12,6 +12,7 @@
 	{"INAM", Ttitle},
 	{"IPRD", Talbum},
 	{"ITRK", Ttrack},
+	{"????", Tunknown},
 };
 
 int
@@ -68,11 +69,12 @@
 			continue;
 		}else if(info){
 			for(n = 0; n < nelem(t); n++){
-				if(memcmp(d, t[n].s, 4) == 0){
-					if(ctx->read(ctx, d, csz) != (int)csz)
+				if(memcmp(d, t[n].s, 4) == 0 || t[n].type == Tunknown){
+					if(ctx->read(ctx, d+5, csz) != (int)csz)
 						return -1;
-					d[csz-1] = 0;
-					txtcb(ctx, t[n].type, "", d);
+					d[4] = 0;
+					d[5+csz-1] = 0;
+					txtcb(ctx, t[n].type, t[n].type == Tunknown ? (char*)d : "", d+5);
 					csz = 0;
 					break;
 				}