From 002182754dd7076b66b7f3188c0b95b47fbec3df Mon Sep 17 00:00:00 2001
From: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
Date: Thu, 19 Jul 2012 21:54:18 -0400
Subject: [PATCH 1/1] v4l2: check correct file descriptor in error handling

---
 libavdevice/v4l2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 4829b1b..96762a6 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -177,7 +177,7 @@ static int device_open(AVFormatContext *ctx)
     }
 #if CONFIG_LIBV4L2
     fd_libv4l = v4l2_fd_open(fd, 0);
-    if (fd < 0) {
+    if (fd_libv4l < 0) {
         err = AVERROR(errno);
         av_log(ctx, AV_LOG_ERROR, "Cannot open video device with libv4l neither %s : %s\n",
                ctx->filename, strerror(errno));
-- 
1.7.9.5

