summaryrefslogtreecommitdiff
path: root/v4l2-apps/libv4l2util/v4l2_driver.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-17 11:17:44 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-17 11:17:44 -0300
commitee117cb21fc99d6d1ef141b62ac07c2c99ed6558 (patch)
treeb3109826151f5b2cacd01a2a78fc51079381fec7 /v4l2-apps/libv4l2util/v4l2_driver.c
parent3c34c6c8fa0c2f378cdad415e8f15c0938c28cb8 (diff)
parent26642526dd562aa77049bb56d5bf9ad64158c767 (diff)
downloadmediapointer-dvb-s2-ee117cb21fc99d6d1ef141b62ac07c2c99ed6558.tar.gz
mediapointer-dvb-s2-ee117cb21fc99d6d1ef141b62ac07c2c99ed6558.tar.bz2
merge: http://kernellabs.com/hg/~mkrufky/saa7164
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l2util/v4l2_driver.c')
-rw-r--r--v4l2-apps/libv4l2util/v4l2_driver.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/v4l2-apps/libv4l2util/v4l2_driver.c b/v4l2-apps/libv4l2util/v4l2_driver.c
index 94f826968..919119b6a 100644
--- a/v4l2-apps/libv4l2util/v4l2_driver.c
+++ b/v4l2-apps/libv4l2util/v4l2_driver.c
@@ -646,6 +646,9 @@ int v4l2_mmap_bufs(struct v4l2_driver *drv, unsigned int num_buffers)
return 0;
}
+/* Returns <0, if error, 0 if nothing to read and <size>, if something
+ read
+ */
int v4l2_rcvbuf(struct v4l2_driver *drv, v4l2_recebe_buffer *rec_buf)
{
int ret;
@@ -668,7 +671,7 @@ int v4l2_rcvbuf(struct v4l2_driver *drv, v4l2_recebe_buffer *rec_buf)
default:
perror ("dqbuf");
- return errno;
+ return -errno;
}
}
prt_buf_info("DQBUF",&buf);
@@ -677,19 +680,18 @@ int v4l2_rcvbuf(struct v4l2_driver *drv, v4l2_recebe_buffer *rec_buf)
ret = rec_buf (&buf,&drv->bufs[buf.index]);
- if (ret) {
+ if (ret<0) {
v4l2_free_bufs(drv);
return ret;
}
if (-1 == xioctl (drv->fd, VIDIOC_QBUF, &buf)) {
perror ("qbuf");
- return errno;
+ return -errno;
}
- return 0;
+ return ret;
}
-
int v4l2_start_streaming(struct v4l2_driver *drv)
{
uint32_t i;