From 7b62611a54861e5d972e61c94a00a843aca44b19 Mon Sep 17 00:00:00 2001
From: Giorgio Vazzana <mywin...@gmail.com>
Date: Fri, 5 Sep 2014 17:39:50 +0200
Subject: [PATCH 4/5] lavd/v4l2: simplify list_framesizes()

We can avoid passing file descriptor fd explicitely.
---
 libavdevice/v4l2.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index a1eed1a..f0d0e2e 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -238,12 +238,12 @@ static int first_field(const struct video_data *s)
 }
 
 #if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE
-static void list_framesizes(AVFormatContext *ctx, int fd, uint32_t pixelformat)
+static void list_framesizes(AVFormatContext *ctx, uint32_t pixelformat)
 {
     const struct video_data *s = ctx->priv_data;
     struct v4l2_frmsizeenum vfse = { .pixel_format = pixelformat };
 
-    while(!v4l2_ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &vfse)) {
+    while(!v4l2_ioctl(s->fd, VIDIOC_ENUM_FRAMESIZES, &vfse)) {
         switch (vfse.type) {
         case V4L2_FRMSIZE_TYPE_DISCRETE:
             av_log(ctx, AV_LOG_INFO, " %ux%u",
@@ -296,7 +296,7 @@ static void list_formats(AVFormatContext *ctx, int fd, int type)
             av_log(ctx, AV_LOG_INFO, " Emulated :");
 #endif
 #if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE
-        list_framesizes(ctx, fd, vfd.pixelformat);
+        list_framesizes(ctx, vfd.pixelformat);
 #endif
         av_log(ctx, AV_LOG_INFO, "\n");
     }
-- 
1.7.9.5

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

Reply via email to