From b41063719e767136fee985ce73e958a2a6549459 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 9 Aug 2011 11:36:15 +0200 Subject: [PATCH] libv4l2: Set errno to EIO if getting 4 consecutive EAGAIN convert errors Signed-off-by: Hans de Goede --- lib/libv4l2/libv4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libv4l2/libv4l2.c b/lib/libv4l2/libv4l2.c index c8e75f7..6c55eb5 100644 --- a/lib/libv4l2/libv4l2.c +++ b/lib/libv4l2/libv4l2.c @@ -339,7 +339,7 @@ static int v4l2_dequeue_and_convert(int index, struct v4l2_buffer *buf, if (result < 0 && errno == EAGAIN) { V4L2_LOG_ERR("got %d consecutive frame decode errors, last error: %s", max_tries, v4lconvert_get_error_message(devices[index].convert)); - errno = EAGAIN; + errno = EIO; } if (result < 0 && errno == EPIPE) { @@ -416,7 +416,7 @@ static int v4l2_read_and_convert(int index, unsigned char *dest, int dest_size) if (result < 0 && errno == EAGAIN) { V4L2_LOG_ERR("got %d consecutive frame decode errors, last error: %s", max_tries, v4lconvert_get_error_message(devices[index].convert)); - errno = EAGAIN; + errno = EIO; } if (result < 0 && errno == EPIPE) { -- 2.7.4