Revision 90d0379f

View differences:

libavdevice/alsa-audio-dec.c
79 79
        return AVERROR(ENOMEM);
80 80
    }
81 81
    sample_rate = ap->sample_rate;
82
    codec_id    = ap->audio_codec_id;
82
    codec_id    = s1->audio_codec_id;
83 83

  
84 84
    ret = ff_alsa_open(s1, SND_PCM_STREAM_CAPTURE, &sample_rate, ap->channels,
85 85
        &codec_id);
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);
libavformat/img2.c
232 232
        st->duration = last_index - first_index + 1;
233 233
    }
234 234

  
235
    if(ap->video_codec_id){
235
    if(s1->video_codec_id){
236 236
        st->codec->codec_type = CODEC_TYPE_VIDEO;
237
        st->codec->codec_id = ap->video_codec_id;
238
    }else if(ap->audio_codec_id){
237
        st->codec->codec_id = s1->video_codec_id;
238
    }else if(s1->audio_codec_id){
239 239
        st->codec->codec_type = CODEC_TYPE_AUDIO;
240
        st->codec->codec_id = ap->audio_codec_id;
240
        st->codec->codec_id = s1->audio_codec_id;
241 241
    }else{
242 242
        st->codec->codec_type = CODEC_TYPE_VIDEO;
243 243
        st->codec->codec_id = av_str2id(img_tags, s->path);

Also available in: Unified diff