From d485180074fd311eeb211bf129633053e1782e31 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 10 Jan 2014 18:00:27 +0100 Subject: [PATCH] validate:tools: Return an exit code != 0 if pipeline can't go to playing And give some information to the user about why the return code is !=0 everywhere it happens --- validate/tools/gst-validate-transcoding.c | 5 ++++- validate/tools/gst-validate.c | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/validate/tools/gst-validate-transcoding.c b/validate/tools/gst-validate-transcoding.c index 412aa3fce5..d8148d0d08 100644 --- a/validate/tools/gst-validate-transcoding.c +++ b/validate/tools/gst-validate-transcoding.c @@ -837,8 +837,11 @@ main (int argc, gchar ** argv) g_print ("Starting pipeline\n"); if (gst_element_set_state (pipeline, - GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) + GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { + g_print ("Pipeline failed to go to PLAYING state\n"); + ret = -1; goto exit; + } g_timeout_add (50, (GSourceFunc) print_position, NULL); g_main_loop_run (mainloop); diff --git a/validate/tools/gst-validate.c b/validate/tools/gst-validate.c index 8eb97bb12e..a442f172d4 100644 --- a/validate/tools/gst-validate.c +++ b/validate/tools/gst-validate.c @@ -94,7 +94,7 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer data) gchar *debug; ret = -1; gst_message_parse_error (message, &err, &debug); - g_print ("Error: %s\n", err->message); + g_print ("Error: %s -- Setting returncode to -1\n", err->message); g_error_free (err); g_free (debug); g_main_loop_quit (loop); @@ -243,6 +243,7 @@ main (int argc, gchar ** argv) if (gst_element_set_state (pipeline, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE) { g_print ("Pipeline failed to go to PLAYING state\n"); + ret = -1; goto exit; } @@ -251,8 +252,10 @@ main (int argc, gchar ** argv) g_main_loop_run (mainloop); rep_err = gst_validate_runner_printf (runner); - if (ret == 0) + if (ret == 0) { ret = rep_err; + g_print ("Returning %d as error where found", rep_err); + } exit: gst_element_set_state (pipeline, GST_STATE_NULL);