Commit b776113e authored by Martin Storsjö's avatar Martin Storsjö

v4l2: Unify one instance of reading/storing errno

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 28396d17
...@@ -348,14 +348,14 @@ static int mmap_init(AVFormatContext *ctx) ...@@ -348,14 +348,14 @@ static int mmap_init(AVFormatContext *ctx)
res = ioctl(s->fd, VIDIOC_REQBUFS, &req); res = ioctl(s->fd, VIDIOC_REQBUFS, &req);
if (res < 0) { if (res < 0) {
res = errno; res = AVERROR(errno);
if (errno == EINVAL) { if (res == AVERROR(EINVAL)) {
av_log(ctx, AV_LOG_ERROR, "Device does not support mmap\n"); av_log(ctx, AV_LOG_ERROR, "Device does not support mmap\n");
} else { } else {
av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_REQBUFS)\n"); av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_REQBUFS)\n");
} }
return AVERROR(res); return res;
} }
if (req.count < 2) { if (req.count < 2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment