shithub: rtmp

Download patch

ref: 3e33a92bc1f6678b510a4141d3cfb6f61437d9bc
parent: 9f57703b6b8536cc581e5b0d71e828b10b3d7b29
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Thu Aug 5 04:15:17 EDT 2021

remove -v option: always read from stdin

--- a/main.c
+++ b/main.c
@@ -12,7 +12,7 @@
 static void
 usage(void)
 {
-	fprint(2, "usage: %s [-a AUDIO] [-v VIDEO] [URL]\n", argv0);
+	fprint(2, "usage: %s [-a AUDIO] URL\n", argv0);
 	threadexitsall("usage");
 }
 
@@ -27,7 +27,6 @@
 	RTMP *r;
 
 	a = nil;
-	v = nil;
 	ARGBEGIN{
 	case 'd':
 		debug++;
@@ -36,10 +35,6 @@
 		if((a = Bopen(EARGF(usage()), OREAD)) == nil)
 			sysfatal("%r");
 		break;
-	case 'v':
-		if((v = Bopen(EARGF(usage()), OREAD)) == nil)
-			sysfatal("%r");
-		break;
 	default:
 		usage();
 	}ARGEND
@@ -46,9 +41,7 @@
 
 	if(argc != 1)
 		usage();
-	if(v == nil)
-		v = Bfdopen(0, OREAD);
-	if(ivfopen(v, &ivf) != 0)
+	if((v = Bfdopen(0, OREAD)) == nil || ivfopen(v, &ivf) != 0)
 		sysfatal("%r");
 	if(strcmp(ivf.type, "AVC1") != 0)
 		sysfatal("not H.264");