Revision 7274a480

View differences:

libavdevice/v4l.c
103 103
        goto fail;
104 104
    }
105 105

  
106
    /* no values set, autodetect them */
107
    if (s->video_win.width <= 0 || s->video_win.height <= 0) {
108
        if (ioctl(video_fd, VIDIOCGWIN, &s->video_win, sizeof(s->video_win)) < 0) {
109
            av_log(s1, AV_LOG_ERROR, "VIDIOCGWIN: %s\n", strerror(errno));
110
            goto fail;
111
        }
112
    }
113

  
114 106
    if (ioctl(video_fd, VIDIOCGCAP, &s->video_cap) < 0) {
115 107
        av_log(s1, AV_LOG_ERROR, "VIDIOCGCAP: %s\n", strerror(errno));
116 108
        goto fail;
......
121 113
        goto fail;
122 114
    }
123 115

  
116
    /* no values set, autodetect them */
117
    if (s->video_win.width <= 0 || s->video_win.height <= 0) {
118
        if (ioctl(video_fd, VIDIOCGWIN, &s->video_win, sizeof(s->video_win)) < 0) {
119
            av_log(s1, AV_LOG_ERROR, "VIDIOCGWIN: %s\n", strerror(errno));
120
            goto fail;
121
        }
122
    }
123

  
124 124
    desired_palette = -1;
125 125
    desired_depth = -1;
126 126
    for (j = 0; j < vformat_num; j++) {

Also available in: Unified diff