Revision 01f4895c libavformat/mmf.c

View differences:

libavformat/mmf.c
61 61
    offset_t pos;
62 62
    int rate;
63 63

  
64
    rate = mmf_rate_code(s->streams[0]->codec.sample_rate);
64
    rate = mmf_rate_code(s->streams[0]->codec->sample_rate);
65 65
    if(rate < 0) {
66
        av_log(s, AV_LOG_ERROR, "Unsupported sample rate %d\n", s->streams[0]->codec.sample_rate);
66
        av_log(s, AV_LOG_ERROR, "Unsupported sample rate %d\n", s->streams[0]->codec->sample_rate);
67 67
        return -1;
68 68
    }
69 69
    
......
96 96

  
97 97
    mmf->awapos = start_tag(pb, "Awa\x01");
98 98

  
99
    av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec.sample_rate);
99
    av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
100 100

  
101 101
    put_flush_packet(pb);
102 102

  
......
144 144
        /* "play wav" */
145 145
        put_byte(pb, 0); /* start time */
146 146
        put_byte(pb, 1); /* (channel << 6) | wavenum */
147
        gatetime = size * 500 / s->streams[0]->codec.sample_rate;
147
        gatetime = size * 500 / s->streams[0]->codec->sample_rate;
148 148
        put_varlength(pb, gatetime); /* duration */
149 149

  
150 150
        /* "nop" */
......
239 239
    if (!st)
240 240
        return AVERROR_NOMEM;
241 241

  
242
    st->codec.codec_type = CODEC_TYPE_AUDIO;
243
    st->codec.codec_id = CODEC_ID_ADPCM_YAMAHA;
244
    st->codec.sample_rate = rate;
245
    st->codec.channels = 1;
246
    st->codec.bits_per_sample = 4;
247
    st->codec.bit_rate = st->codec.sample_rate * st->codec.bits_per_sample;
242
    st->codec->codec_type = CODEC_TYPE_AUDIO;
243
    st->codec->codec_id = CODEC_ID_ADPCM_YAMAHA;
244
    st->codec->sample_rate = rate;
245
    st->codec->channels = 1;
246
    st->codec->bits_per_sample = 4;
247
    st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_sample;
248 248

  
249
    av_set_pts_info(st, 64, 1, st->codec.sample_rate);
249
    av_set_pts_info(st, 64, 1, st->codec->sample_rate);
250 250

  
251 251
    return 0;
252 252
}

Also available in: Unified diff