aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-ctl
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-22 14:00:23 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-22 14:00:23 +0100
commit40fd5611c5176137c80616f6ee93b36f0d88f2d5 (patch)
tree485cbb8cd18db042f90c60a3df8101b50999a23c /utils/v4l2-ctl
parentc4d38989392af33c25a5e4796d15ba975e113f46 (diff)
v4l2-ctl: fix small do_handle_cap bug
do_handle_cap() returns -2 if EPIPE what returned, and it should also return -2 when stream_count reaches 0 since -2 indicates end-of-stream. But when capturing the error code was only checks for -1 instead of < 0. Fix this as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/v4l2-ctl')
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 33ca1ee7..7a87783d 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -1280,7 +1280,7 @@ static int do_handle_cap(cv4l_fd &fd, cv4l_queue &q, FILE *fout, int *index,
if (stream_count == 0)
return 0;
if (--stream_count == 0)
- return -1;
+ return -2;
return 0;
}
@@ -1641,7 +1641,7 @@ recover:
if (FD_ISSET(fd.g_fd(), &read_fds)) {
r = do_handle_cap(fd, q, fout, NULL,
count, fps_ts, fmt);
- if (r == -1)
+ if (r < 0)
break;
}

Privacy Policy