Updated the examples exit if the pipeline doesn't want to go to the playing state.
[platform/upstream/gstreamer.git] / tools / gstreamer-launch.c
index e50db14..9d0a13c 100644 (file)
@@ -167,7 +167,10 @@ main(int argc, char *argv[])
     arg_search(GST_BIN(pipeline),"xid",xid_handler,NULL);
 
     fprintf(stderr,"RUNNING pipeline\n");
-    gst_element_set_state (pipeline, GST_STATE_PLAYING);
+    if (gst_element_set_state (pipeline, GST_STATE_PLAYING) != GST_STATE_SUCCESS) {
+      fprintf(stderr,"pipeline doesn't want to play\n");
+      exit (-1);
+    }
 
     g_idle_add(idle_func,pipeline);
 #ifdef USE_GLIB2