[FFmpeg-cvslog] r16318 - trunk/libavdevice/v4l.c
stefano
subversion
Fri Dec 26 11:12:58 CET 2008
Author: stefano
Date: Fri Dec 26 11:12:57 2008
New Revision: 16318
Log:
Check that the device is a capture device immediately after opening
the device.
Modified:
trunk/libavdevice/v4l.c
Modified: trunk/libavdevice/v4l.c
==============================================================================
--- trunk/libavdevice/v4l.c Fri Dec 26 10:31:21 2008 (r16317)
+++ trunk/libavdevice/v4l.c Fri Dec 26 11:12:57 2008 (r16318)
@@ -103,14 +103,6 @@ static int grab_read_header(AVFormatCont
goto fail;
}
- /* no values set, autodetect them */
- if (s->video_win.width <= 0 || s->video_win.height <= 0) {
- if (ioctl(video_fd, VIDIOCGWIN, &s->video_win, sizeof(s->video_win)) < 0) {
- av_log(s1, AV_LOG_ERROR, "VIDIOCGWIN: %s\n", strerror(errno));
- goto fail;
- }
- }
-
if (ioctl(video_fd, VIDIOCGCAP, &s->video_cap) < 0) {
av_log(s1, AV_LOG_ERROR, "VIDIOCGCAP: %s\n", strerror(errno));
goto fail;
@@ -121,6 +113,14 @@ static int grab_read_header(AVFormatCont
goto fail;
}
+ /* no values set, autodetect them */
+ if (s->video_win.width <= 0 || s->video_win.height <= 0) {
+ if (ioctl(video_fd, VIDIOCGWIN, &s->video_win, sizeof(s->video_win)) < 0) {
+ av_log(s1, AV_LOG_ERROR, "VIDIOCGWIN: %s\n", strerror(errno));
+ goto fail;
+ }
+ }
+
desired_palette = -1;
desired_depth = -1;
for (j = 0; j < vformat_num; j++) {
More information about the ffmpeg-cvslog
mailing list