Revision b9f382c8 libavdevice/v4l.c

View differences:

libavdevice/v4l.c
72 72
    AVStream *st;
73 73
    int width, height;
74 74
    int video_fd, frame_size;
75
    int ret, frame_rate, frame_rate_base;
75
    int frame_rate, frame_rate_base;
76 76
    int desired_palette, desired_depth;
77 77
    struct video_tuner tuner;
78 78
    struct video_audio audio;
......
167 167
    /* try to choose a suitable video format */
168 168
    pict.palette = desired_palette;
169 169
    pict.depth= desired_depth;
170
    if (desired_palette == -1 || (ret = ioctl(video_fd, VIDIOCSPICT, &pict)) < 0) {
170
    if (desired_palette == -1 || ioctl(video_fd, VIDIOCSPICT, &pict) < 0) {
171 171
        for (j = 0; j < vformat_num; j++) {
172 172
            pict.palette = video_formats[j].palette;
173 173
            pict.depth = video_formats[j].depth;
......
178 178
            goto fail1;
179 179
    }
180 180

  
181
    ret = ioctl(video_fd,VIDIOCGMBUF,&s->gb_buffers);
182
    if (ret < 0) {
181
    if (ioctl(video_fd,VIDIOCGMBUF,&s->gb_buffers) < 0) {
183 182
        /* try to use read based access */
184 183
        struct video_window win;
185 184
        int val;
......
218 217
        s->gb_buf.width = width;
219 218
        s->gb_buf.format = pict.palette;
220 219

  
221
        ret = ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf);
222
        if (ret < 0) {
220
        if (ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf) < 0) {
223 221
            if (errno != EAGAIN) {
224 222
            fail1:
225 223
                av_log(s1, AV_LOG_ERROR, "Fatal: grab device does not support suitable format\n");

Also available in: Unified diff