Revision ce20edb7 libavformat/oggparsevorbis.c

View differences:

libavformat/oggparsevorbis.c
221 221
    if (os->buf[os->pstart] == 1) {
222 222
        const uint8_t *p = os->buf + os->pstart + 7; /* skip "\001vorbis" tag */
223 223
        unsigned blocksize, bs0, bs1;
224
        int srate;
224 225

  
225 226
        if (os->psize != 30)
226 227
            return -1;
......
229 230
            return -1;
230 231

  
231 232
        st->codec->channels = bytestream_get_byte(&p);
232
        st->codec->sample_rate = bytestream_get_le32(&p);
233
        srate = bytestream_get_le32(&p);
233 234
        p += 4; // skip maximum bitrate
234 235
        st->codec->bit_rate = bytestream_get_le32(&p); // nominal bitrate
235 236
        p += 4; // skip minimum bitrate
......
249 250
        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
250 251
        st->codec->codec_id = CODEC_ID_VORBIS;
251 252

  
252
        st->time_base.num = 1;
253
        st->time_base.den = st->codec->sample_rate;
253
        if (srate > 0) {
254
            st->codec->sample_rate = srate;
255
            st->time_base.num = 1;
256
            st->time_base.den = srate;
257
        }
254 258
    } else if (os->buf[os->pstart] == 3) {
255 259
        if (os->psize > 8)
256 260
            ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8);

Also available in: Unified diff