libv4l2: Set errno to EIO if getting 4 consecutive EAGAIN convert errors
authorHans de Goede <hdegoede@redhat.com>
Tue, 9 Aug 2011 09:36:15 +0000 (11:36 +0200)
committerHans de Goede <hdegoede@redhat.com>
Wed, 14 Sep 2011 09:20:46 +0000 (11:20 +0200)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
lib/libv4l2/libv4l2.c

index c8e75f7..6c55eb5 100644 (file)
@@ -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) {