summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2014-11-10 09:49:01 +0200
committerMartin Storsjö <martin@martin.st>2014-11-11 10:07:20 +0200
commitb776113e5d4a56759615196de98efe802e95a6b6 (patch)
tree183deecb49f866132ef9f8f4415ff8366c89fe2d /libavdevice
parent28396d17ff1c1493b78d6eece484ffc27ed86d0d (diff)
v4l2: Unify one instance of reading/storing errno
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/v4l2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index fdec0ecdcc..302639d244 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -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) {