summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2013-11-14 15:32:59 +0100
committerSebastian Dröge <sebastian@centricular.com>2013-11-25 12:12:39 +0100
commit6e4cab65418bb5b16fe6ae31b3d79e5d535cbff5 (patch)
tree5f26fe24f430fc0f730498c97f932d1fccba1d0d /tools
parent7a073cdcda5be725da8f763e6445b1b12e4a1339 (diff)
downloadgstreamer-6e4cab65418bb5b16fe6ae31b3d79e5d535cbff5.tar.gz
gst-launch: exit with an error code when an error occured
If the pipeline failed to pre-roll or the user interrupted the execution then set the exit code to a positive value. https://bugzilla.gnome.org/show_bug.cgi?id=712300
Diffstat (limited to 'tools')
-rw-r--r--tools/gst-launch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/gst-launch.c b/tools/gst-launch.c
index b5f0438fd5..280b428590 100644
--- a/tools/gst-launch.c
+++ b/tools/gst-launch.c
@@ -1044,6 +1044,7 @@ main (int argc, char *argv[])
caught_error = event_loop (pipeline, TRUE, TRUE, GST_STATE_PAUSED);
if (caught_error) {
g_printerr (_("ERROR: pipeline doesn't want to preroll.\n"));
+ res = caught_error;
goto end;
}
state = GST_STATE_PAUSED;
@@ -1057,6 +1058,7 @@ main (int argc, char *argv[])
if (caught_error) {
g_printerr (_("ERROR: pipeline doesn't want to preroll.\n"));
+ res = caught_error;
} else {
GstClockTime tfthen, tfnow;
GstClockTimeDiff diff;
@@ -1105,10 +1107,12 @@ main (int argc, char *argv[])
} else if (caught_error == ELR_INTERRUPT) {
PRINT (_
("Interrupt while waiting for EOS - stopping pipeline...\n"));
+ res = caught_error;
break;
} else if (caught_error == ELR_ERROR) {
if (!ignore_errors) {
PRINT (_("An error happened while waiting for EOS\n"));
+ res = caught_error;
break;
}
}