Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiorgio Vazzana <mywing81@gmail.com>2014-09-05 19:24:43 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-09-05 20:36:04 +0400
commit3da359c140a29c1f45eb7844a6d68aa958cd604c (patch)
tree2cef0b861c99ae283a429839b1806dc2571040c6 /libavdevice/v4l2.c
parent39750b73641e4a2f10e4c025b6424d1c864683fb (diff)
lavd/v4l2: simplify first_field()
There is no need to pass fd as a second parameter. Additionally remove unneeded curly braces. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index a765e64c3a..2fd496651b 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;