mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
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
This commit is contained in:
parent
5c982f6113
commit
e8346c5789
1 changed files with 4 additions and 0 deletions
|
@ -1042,6 +1042,7 @@ main (int argc, char *argv[])
|
||||||
caught_error = event_loop (pipeline, TRUE, TRUE, GST_STATE_PAUSED);
|
caught_error = event_loop (pipeline, TRUE, TRUE, GST_STATE_PAUSED);
|
||||||
if (caught_error) {
|
if (caught_error) {
|
||||||
g_printerr (_("ERROR: pipeline doesn't want to preroll.\n"));
|
g_printerr (_("ERROR: pipeline doesn't want to preroll.\n"));
|
||||||
|
res = caught_error;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
state = GST_STATE_PAUSED;
|
state = GST_STATE_PAUSED;
|
||||||
|
@ -1055,6 +1056,7 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
if (caught_error) {
|
if (caught_error) {
|
||||||
g_printerr (_("ERROR: pipeline doesn't want to preroll.\n"));
|
g_printerr (_("ERROR: pipeline doesn't want to preroll.\n"));
|
||||||
|
res = caught_error;
|
||||||
} else {
|
} else {
|
||||||
GstClockTime tfthen, tfnow;
|
GstClockTime tfthen, tfnow;
|
||||||
GstClockTimeDiff diff;
|
GstClockTimeDiff diff;
|
||||||
|
@ -1103,10 +1105,12 @@ main (int argc, char *argv[])
|
||||||
} else if (caught_error == ELR_INTERRUPT) {
|
} else if (caught_error == ELR_INTERRUPT) {
|
||||||
PRINT (_
|
PRINT (_
|
||||||
("Interrupt while waiting for EOS - stopping pipeline...\n"));
|
("Interrupt while waiting for EOS - stopping pipeline...\n"));
|
||||||
|
res = caught_error;
|
||||||
break;
|
break;
|
||||||
} else if (caught_error == ELR_ERROR) {
|
} else if (caught_error == ELR_ERROR) {
|
||||||
if (!ignore_errors) {
|
if (!ignore_errors) {
|
||||||
PRINT (_("An error happened while waiting for EOS\n"));
|
PRINT (_("An error happened while waiting for EOS\n"));
|
||||||
|
res = caught_error;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue