]> git.sesse.net Git - ffmpeg/commitdiff
v4l2: Unify one instance of reading/storing errno
authorMartin Storsjö <martin@martin.st>
Mon, 10 Nov 2014 07:49:01 +0000 (09:49 +0200)
committerMartin Storsjö <martin@martin.st>
Tue, 11 Nov 2014 08:07:20 +0000 (10:07 +0200)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavdevice/v4l2.c

index fdec0ecdcc8998e3635f07291b6279c586f0150a..302639d244a9236ebbf835129d460518adcb4d34 100644 (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) {