From 5642dbb81dadff02c63b454726b1ca4c99ee1c2c Mon Sep 17 00:00:00 2001
From: Giorgio Vazzana <mywin...@gmail.com>
Date: Fri, 5 Sep 2014 17:24:43 +0200
Subject: [PATCH 2/5] lavd/v4l2: simplify first_field()

There is no need to pass fd as a second parameter. Additionally remove
unneeded curly braces.
---
 libavdevice/v4l2.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index a765e64..2fd4966 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -225,18 +225,16 @@ static int device_init(AVFormatContext *ctx, int *width, int *height,
     return res;
 }
 
-static int first_field(const struct video_data *s, int fd)
+static int first_field(const struct video_data *s)
 {
     int res;
     v4l2_std_id std;
 
-    res = v4l2_ioctl(fd, VIDIOC_G_STD, &std);
-    if (res < 0) {
+    res = v4l2_ioctl(s->fd, VIDIOC_G_STD, &std);
+    if (res < 0)
         return 0;
-    }
-    if (std & V4L2_STD_NTSC) {
+    if (std & V4L2_STD_NTSC)
         return 0;
-    }
 
     return 1;
 }
@@ -935,7 +933,7 @@ static int v4l2_read_header(AVFormatContext *ctx)
         (res = mmap_start(ctx)) < 0)
             goto fail;
 
-    s->top_field_first = first_field(s, s->fd);
+    s->top_field_first = first_field(s);
 
     st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     st->codec->codec_id = codec_id;
-- 
1.7.9.5

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to