shithub: treason

Download patch

ref: 7b98be7fa1d53ad1e1d2edb3a9e4f8ca432ff438
parent: fbfa3d1b9849a84daae2cf3d447f6495bf3e994d
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sat Jan 16 06:59:24 EST 2021

add benchmark mode (plays as fast as possible, audio disabled)

--- a/main.c
+++ b/main.c
@@ -24,6 +24,7 @@
 static int framedrop;
 static uvlong late;
 static int bw;
+static int benchmark;
 
 static void
 audioproc(void *x)
@@ -102,6 +103,7 @@
 
 	dispdelay = nanosec() - x;
 
+	if(!benchmark)
 	while(1){
 		x = nanosec();
 		if(x >= end - 1*1000ULL*1000ULL)
@@ -184,6 +186,9 @@
 		}
 		audio = EARGF(usage());
 		break;
+	case 'B':
+		benchmark++;
+		break;
 	case 'b':
 		bw++;
 		break;
@@ -230,7 +235,7 @@
 		for(j = 0; j < nstreams; j++){
 			if(stream[j].type == Svideo && svideo == nil)
 				svideo = stream+j;
-			else if(stream[j].type == Saudio && saudio == nil)
+			else if(stream[j].type == Saudio && saudio == nil && !benchmark)
 				saudio = stream+j;
 			else
 				Sclose(stream+j);