mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 11:49:48 +00:00
Error path fix: close the video device on failure
Original patch by Flavio Pimentel Duarte (flaviop AT land DOT ufrj DOT br) Originally committed as revision 5075 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
40116978de
commit
2b63c22255
@ -126,17 +126,20 @@ static int device_open(const char *devname, uint32_t *capabilities)
|
||||
if (res < 0 && errno == 515)
|
||||
{
|
||||
av_log(NULL, AV_LOG_ERROR, "QUERYCAP not implemented, probably V4L device but not supporting V4L2\n");
|
||||
close(fd);
|
||||
|
||||
return -1;
|
||||
}
|
||||
if (res < 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYCAP): %s\n",
|
||||
strerror(errno));
|
||||
close(fd);
|
||||
|
||||
return -1;
|
||||
}
|
||||
if ((cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) == 0) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Not a video capture device\n");
|
||||
close(fd);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user