playback-test: guard against crash on failure to create pipeline
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 11 May 2017 09:59:21 +0000 (10:59 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 11 May 2017 10:00:55 +0000 (11:00 +0100)
It can happen when giving incorrect parameters (ie, a URI when
expecting a pipeline, etc)

tests/examples/playback/playback-test.c

index 18b5b54..9ec2cb3 100644 (file)
@@ -3478,7 +3478,10 @@ main (int argc, char **argv)
   }
 
   pipelines[app.pipeline_type].func (&app, app.current_path->data);
-  g_assert (app.pipeline);
+  if (!app.pipeline || !GST_IS_PIPELINE (app.pipeline)) {
+    g_print ("Pipeline failed on %s\n", argv[3]);
+    exit (-1);
+  }
 
   create_ui (&app);