Commit 47fa56ac authored by Aaron Boxer's avatar Aaron Boxer
Browse files

fix yet another bug in the command line processing

parent b6d38eb1
Pipeline #19946 failed with stage
in 5 minutes and 13 seconds
......@@ -155,8 +155,11 @@ main (int argc, char *argv[])
// g_print("command line: %s\n",argv[i]);
/* Initialize GStreamer */
if (argc > 2)
if (argc > 3)
gst_debug_set_threshold_from_string(argv[3], TRUE);
std::string fname;
if (argc > 2)
fname = argv[2];
gst_init (&argc, &argv);
/* Initialize our data structure */
......@@ -176,7 +179,7 @@ main (int argc, char *argv[])
char * pipe = new char[LINE_SIZE * 100];
// read configuration file, if present
FILE* fp = fopen(argc > 1 ? argv[1] : "pipeline.txt", "r");
FILE* fp = fopen(fname.c_str(), "r");
char* line = NULL;
if (fp ) {
pipe[0] = 0;
......@@ -186,7 +189,7 @@ main (int argc, char *argv[])
}
fclose(fp);
} else {
g_print("Unable to open file %s", argv[1]);
g_print("Unable to open file %s", fname.c_str());
return 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment