[FFmpeg-cvslog] Revert "v4l2: poll the file descriptor"

Michael Niedermayer git at videolan.org
Wed Jan 11 15:08:11 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jan 11 14:17:16 2012 +0100| [106f714d30d01fe1905946e9531594e7c28fa016] | committer: Michael Niedermayer

Revert "v4l2: poll the file descriptor"

This reverts commit 0efd48dfd15273a5ac85f2fd42f19d419fafe90d.
Reason for the revert is that the code seems based on some
misunderstanding on how the code works.

Conflicts:

	libavdevice/v4l2.c

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavdevice/v4l2.c |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 29ec6af..be461c2 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -38,7 +38,6 @@
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <sys/time.h>
-#include <poll.h>
 #if HAVE_SYS_VIDEOIO_H
 #include <sys/videoio.h>
 #else
@@ -55,7 +54,6 @@
 #include "libavutil/parseutils.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/avstring.h"
-#include "libavutil/mathematics.h"
 
 #if CONFIG_LIBV4L2
 #include <libv4l2.h>
@@ -81,7 +79,6 @@ struct video_data {
     int frame_format; /* V4L2_PIX_FMT_* */
     int width, height;
     int frame_size;
-    int timeout;
     int interlaced;
     int top_field_first;
 
@@ -462,16 +459,8 @@ static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt)
         .memory = V4L2_MEMORY_MMAP
     };
     struct buff_data *buf_descriptor;
-    struct pollfd p = { .fd = s->fd, .events = POLLIN };
     int res;
 
-    res = poll(&p, 1, s->timeout);
-    if (res < 0)
-        return AVERROR(errno);
-
-    if (!(p.revents & (POLLIN | POLLERR | POLLHUP)))
-        return AVERROR(EAGAIN);
-
     /* FIXME: Some special treatment might be needed in case of loss of signal... */
     while ((res = v4l2_ioctl(s->fd, VIDIOC_DQBUF, &buf)) < 0 && (errno == EINTR));
     if (res < 0) {
@@ -658,10 +647,6 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap)
     s1->streams[0]->codec->time_base.den = tpf->denominator;
     s1->streams[0]->codec->time_base.num = tpf->numerator;
 
-    s->timeout = 100 +
-        av_rescale_q(1, s1->streams[0]->codec->time_base,
-                        (AVRational){1, 1000});
-
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list