Allow aborting on write error to stdout when -t 0 specified (#521)

* Allow aborting on write error to stdout when `-t 0` specified

* Allow aborting on write error to stdout when `-t 0` specified in raspividyuv
This commit is contained in:
David Girault
2019-01-09 17:12:02 +01:00
committed by James Hughes
parent 3617b3f5c0
commit 20f03b4f39
2 changed files with 7 additions and 7 deletions

View File

@@ -2287,10 +2287,10 @@ static int wait_for_next_change(RASPIVID_STATE *state)
case WAIT_METHOD_FOREVER:
{
// We never return from this. Expect a ctrl-c to exit.
while (1)
// We never return from this. Expect a ctrl-c to exit or abort.
while (!state->callback_data.abort)
// Have a sleep so we don't hog the CPU.
vcos_sleep(10000);
vcos_sleep(ABORT_INTERVAL);
return 0;
}

View File

@@ -1145,10 +1145,10 @@ static int wait_for_next_change(RASPIVIDYUV_STATE *state)
case WAIT_METHOD_FOREVER:
{
// We never return from this. Expect a ctrl-c to exit.
while (1)
// Have a sleep so we don't hog the CPU.
vcos_sleep(10000);
// We never return from this. Expect a ctrl-c to exit or abort.
while (!state->callback_data.abort)
// Have a sleep so we don't hog the CPU.
vcos_sleep(ABORT_INTERVAL);
return 0;
}