From 7c9480e22058e965a0439f58c7f59e40bb0ce5c2 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 28 Apr 2003 17:01:44 +0000 Subject: [PATCH] parsing returns elements, not bins - so put it into a pipeline if it's not a bin Original commit message from CVS: parsing returns elements, not bins - so put it into a pipeline if it's not a bin --- tools/gst-launch.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/gst-launch.c b/tools/gst-launch.c index be564ad..87ea966 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -322,6 +322,16 @@ main(int argc, char *argv[]) #endif if (!savefile) { + + if (!GST_IS_BIN (pipeline)) { + GstElement *real_pipeline = gst_element_factory_make ("pipeline", NULL); + if (real_pipeline == NULL) { + fprintf(stderr, "ERROR: The pipeline element wasn't found.\n"); + exit(1); + } + gst_bin_add (GST_BIN (real_pipeline), pipeline); + pipeline = real_pipeline; + } fprintf(stderr,"RUNNING pipeline\n"); if (gst_element_set_state (pipeline, GST_STATE_PLAYING) == GST_STATE_FAILURE) { @@ -353,4 +363,3 @@ end: return res; } - -- 2.7.4