mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
v4l2: remove call to v4l2_fd_open.
v4l2_fd_open is already called at the end of v4l2_open; calling a second time leaks structures inside libv4l2. Fix trac ticket #1560.
This commit is contained in:
parent
b040ffc84c
commit
fd58678b86
@ -156,9 +156,6 @@ static int device_open(AVFormatContext *ctx)
|
|||||||
{
|
{
|
||||||
struct v4l2_capability cap;
|
struct v4l2_capability cap;
|
||||||
int fd;
|
int fd;
|
||||||
#if CONFIG_LIBV4L2
|
|
||||||
int fd_libv4l;
|
|
||||||
#endif
|
|
||||||
int res, err;
|
int res, err;
|
||||||
int flags = O_RDWR;
|
int flags = O_RDWR;
|
||||||
|
|
||||||
@ -175,16 +172,6 @@ static int device_open(AVFormatContext *ctx)
|
|||||||
|
|
||||||
return AVERROR(err);
|
return AVERROR(err);
|
||||||
}
|
}
|
||||||
#if CONFIG_LIBV4L2
|
|
||||||
fd_libv4l = v4l2_fd_open(fd, 0);
|
|
||||||
if (fd < 0) {
|
|
||||||
err = AVERROR(errno);
|
|
||||||
av_log(ctx, AV_LOG_ERROR, "Cannot open video device with libv4l neither %s : %s\n",
|
|
||||||
ctx->filename, strerror(errno));
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
fd = fd_libv4l;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
res = v4l2_ioctl(fd, VIDIOC_QUERYCAP, &cap);
|
res = v4l2_ioctl(fd, VIDIOC_QUERYCAP, &cap);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user