diff --git a/tools/gst-launch.c b/tools/gst-launch.c index 13d3c02f7f..47c0ab80e1 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -1042,6 +1042,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; @@ -1055,6 +1056,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; @@ -1103,10 +1105,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; } }