1
0
mirror of https://github.com/BELABOX/belacoder.git synced 2026-07-04 12:06:41 +00:00

Add a version (-v) command line argument

This commit is contained in:
rationalsa
2021-09-22 22:18:15 +01:00
parent 9a0321d8c1
commit 5e69fc04c8
2 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
CFLAGS=`pkg-config gstreamer-1.0 gstreamer-app-1.0 srt --cflags` -O2 -Wall
VERSION=$(shell git rev-parse --short HEAD)
CFLAGS=`pkg-config gstreamer-1.0 gstreamer-app-1.0 srt --cflags` -O2 -Wall -DVERSION=\"$(VERSION)\"
LDFLAGS=`pkg-config gstreamer-1.0 gstreamer-app-1.0 srt --libs` -ldl
all: submodule belacoder
+5 -1
View File
@@ -360,6 +360,7 @@ int connect_srt(char *host, char *port, char *stream_id) {
void exit_syntax() {
fprintf(stderr, "Syntax: belacoder PIPELINE_FILE ADDR PORT [options]\n\n");
fprintf(stderr, "Options:\n");
fprintf(stderr, " -v Print the version and exit\n");
fprintf(stderr, " -d <delay> Audio-video delay in milliseconds\n");
fprintf(stderr, " -s <streamid> SRT stream ID\n");
fprintf(stderr, " -l <latency> SRT latency in milliseconds\n");
@@ -407,7 +408,7 @@ int main(int argc, char** argv) {
char *stream_id = NULL;
srt_latency = DEF_SRT_LATENCY;
while ((opt = getopt(argc, argv, "d:b:s:l:")) != -1) {
while ((opt = getopt(argc, argv, "d:b:s:l:v")) != -1) {
switch (opt) {
case 'b':
bitrate_filename = optarg;
@@ -430,6 +431,9 @@ int main(int argc, char** argv) {
exit_syntax();
}
break;
case 'v':
printf(VERSION "\n");
exit(0);
default:
exit_syntax();
}