Revision 90d0379f libavdevice/v4l2.c

View differences:

libavdevice/v4l2.c
552 552
                                int *height,
553 553
                                enum CodecID *codec_id)
554 554
{
555
    uint32_t desired_format = fmt_ff2v4l(ap->pix_fmt, ap->video_codec_id);
555
    uint32_t desired_format = fmt_ff2v4l(ap->pix_fmt, s1->video_codec_id);
556 556

  
557 557
    if (desired_format == 0 ||
558 558
        device_init(s1, width, height, desired_format) < 0) {
......
560 560

  
561 561
        desired_format = 0;
562 562
        for (i = 0; i<FF_ARRAY_ELEMS(fmt_conversion_table); i++) {
563
            if (ap->video_codec_id == CODEC_ID_NONE ||
564
                fmt_conversion_table[i].codec_id == ap->video_codec_id) {
563
            if (s1->video_codec_id == CODEC_ID_NONE ||
564
                fmt_conversion_table[i].codec_id == s1->video_codec_id) {
565 565
                desired_format = fmt_conversion_table[i].v4l2_fmt;
566 566
                if (device_init(s1, width, height, desired_format) >= 0) {
567 567
                    break;
......
617 617
    desired_format = device_try_init(s1, ap, &width, &height, &codec_id);
618 618
    if (desired_format == 0) {
619 619
        av_log(s1, AV_LOG_ERROR, "Cannot find a proper format for "
620
               "codec_id %d, pix_fmt %d.\n", ap->video_codec_id, ap->pix_fmt);
620
               "codec_id %d, pix_fmt %d.\n", s1->video_codec_id, ap->pix_fmt);
621 621
        close(s->fd);
622 622

  
623 623
        return AVERROR(EIO);

Also available in: Unified diff