Browse Source

v4l2: Unify one instance of reading/storing errno

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n2.5
Martin Storsjö 11 years ago
parent
commit
b776113e5d
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      libavdevice/v4l2.c

+ 3
- 3
libavdevice/v4l2.c View File

@@ -348,14 +348,14 @@ static int mmap_init(AVFormatContext *ctx)

res = ioctl(s->fd, VIDIOC_REQBUFS, &req);
if (res < 0) {
res = errno;
if (errno == EINVAL) {
res = AVERROR(errno);
if (res == AVERROR(EINVAL)) {
av_log(ctx, AV_LOG_ERROR, "Device does not support mmap\n");
} else {
av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_REQBUFS)\n");
}

return AVERROR(res);
return res;
}

if (req.count < 2) {


Loading…
Cancel
Save