shithub: mcfs

Download patch

ref: 0cb8bd19aa3e819f28484ac1fda7ed20845f2c8c
parent: f597758079cff5504bf21fad75e4c40ecc0a90a0
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sat Jan 16 08:40:59 EST 2021

mkvdump: display timestamps

--- a/extra/mkvdump.c
+++ b/extra/mkvdump.c
@@ -20,6 +20,7 @@
 	Biobuf in, out;
 	Elspec s;
 	double d;
+	Tm tm;
 
 	hxsz = 32;
 	ARGBEGIN{
@@ -42,6 +43,7 @@
 
 	quotefmtinstall();
 	fmtinstall('H', encodefmt);
+	tmfmtinstall();
 	Binit(&in, fd, OREAD);
 	Binit(&out, 1, OWRITE);
 
@@ -121,6 +123,12 @@
 			sz -= n;
 			break;
 		case Etimestamp:
+			if(ebmlrawsint(&in, sz, &x) < 0)
+				goto err;
+			x /= 1000000000ULL;
+			x += 978307200ULL;
+			Bprint(&out, "%τ", tmfmt(tmtime(&tm, x, nil), nil));
+			sz = 0;
 			break;
 		case Emaster:
 			break;