mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
fixed a bug with NULL args, but need to fix the parser that created them
Original commit message from CVS: fixed a bug with NULL args, but need to fix the parser that created them
This commit is contained in:
parent
2763642766
commit
c116d7baa5
1 changed files with 14 additions and 1 deletions
|
@ -79,6 +79,8 @@ gint parse_cmdline(int argc,char *argv[],GstBin *parent) {
|
|||
|
||||
while (i < argc) {
|
||||
arg = argv[i];
|
||||
// FIXME this is a lame solution for problems with the first parser
|
||||
if (arg == NULL) { i++;continue; }
|
||||
len = strlen(arg);
|
||||
element = NULL;
|
||||
DEBUG("** ARGUMENT is '%s'\n",arg);
|
||||
|
@ -166,10 +168,18 @@ gint parse_cmdline(int argc,char *argv[],GstBin *parent) {
|
|||
if (arg[0] == '(') {
|
||||
// create a bin and add it to the current parent
|
||||
element = gst_bin_new(g_strdup_printf("bin%d",bincount++));
|
||||
if (!element) {
|
||||
fprintf(stderr,"Couldn't create a bin!\n");
|
||||
exit(-1);
|
||||
}
|
||||
VERBOSE("CREATED bin %s\n",gst_element_get_name(element));
|
||||
} else if (arg[0] == '{') {
|
||||
// create a thread and add it to the current parent
|
||||
element = gst_thread_new(g_strdup_printf("thread%d",threadcount++));
|
||||
if (!element) {
|
||||
fprintf(stderr,"Couldn't create a thread!\n");
|
||||
exit(-1);
|
||||
}
|
||||
VERBOSE("CREATED thread %s\n",gst_element_get_name(element));
|
||||
}
|
||||
|
||||
|
@ -179,6 +189,10 @@ gint parse_cmdline(int argc,char *argv[],GstBin *parent) {
|
|||
// we have an element
|
||||
DEBUG("attempting to create element '%s'\n",arg);
|
||||
element = gst_elementfactory_make(arg,unique_name(arg));
|
||||
if (!element) {
|
||||
fprintf(stderr,"Couldn't create a '%s', no such element or need to run gstraemer-register?\n",arg);
|
||||
exit(-1);
|
||||
}
|
||||
VERBOSE("CREATED element %s\n",gst_element_get_name(element));
|
||||
DEBUG("created element %s\n",gst_element_get_name(element));
|
||||
}
|
||||
|
@ -334,7 +348,6 @@ gint parse(int argc,char *argv[],GstBin *parent) {
|
|||
int main(int argc,char *argv[]) {
|
||||
GstElement *pipeline;
|
||||
int firstarg;
|
||||
guint i;
|
||||
|
||||
gst_init(&argc,&argv);
|
||||
|
||||
|
|
Loading…
Reference in a new issue