[FFmpeg-cvslog] v4l2: use OFFSET macro when setting options

Stefano Sabatini git at videolan.org
Sat May 28 21:24:03 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Sat May 28 20:38:06 2011 +0200| [f8f3f6c40bb452bb716096f455391f3fba324190] | committer: Stefano Sabatini

v4l2: use OFFSET macro when setting options

Improve readability.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8f3f6c40bb452bb716096f455391f3fba324190
---

 libavdevice/v4l2.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 830fe0c..d06ec29 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -715,9 +715,10 @@ static int v4l2_read_close(AVFormatContext *s1)
 
 #define OFFSET(x) offsetof(struct video_data, x)
 #define DEC AV_OPT_FLAG_DECODING_PARAM
+
 static const AVOption options[] = {
-    { "standard", "", offsetof(struct video_data, standard), FF_OPT_TYPE_STRING, {.str = "NTSC" }, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
-    { "channel",  "", offsetof(struct video_data, channel),  FF_OPT_TYPE_INT,    {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
+    { "standard", "", OFFSET(standard), FF_OPT_TYPE_STRING, {.str = "NTSC" }, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
+    { "channel",  "", OFFSET(channel),  FF_OPT_TYPE_INT,    {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
     { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
     { NULL },
 };



More information about the ffmpeg-cvslog mailing list