Revision 0fc07ad9

View differences:

libavformat/ape.c
310 310
    st->codec->frame_size      = MAC_SUBFRAME_SIZE;
311 311

  
312 312
    st->nb_frames = ape->totalframes;
313
    s->start_time = 0;
314
    s->duration   = (int64_t) total_blocks * AV_TIME_BASE / ape->samplerate;
313
    st->start_time = 0;
314
    st->duration  = total_blocks / MAC_SUBFRAME_SIZE;
315 315
    av_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate);
316 316

  
317 317
    st->codec->extradata = av_malloc(APE_EXTRADATA_SIZE);
libavformat/mpc.c
115 115
    st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3];
116 116
    av_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate);
117 117
    /* scan for seekpoints */
118
    s->start_time = 0;
119
    s->duration = (int64_t)c->fcount * MPC_FRAMESIZE * AV_TIME_BASE / st->codec->sample_rate;
118
    st->start_time = 0;
119
    st->duration = c->fcount;
120 120

  
121 121
    /* try to read APE tags */
122 122
    if (!url_is_streamed(s->pb)) {
libavformat/wv.c
168 168
    st->codec->sample_rate = wc->rate;
169 169
    st->codec->bits_per_coded_sample = wc->bpp;
170 170
    av_set_pts_info(st, 64, 1, wc->rate);
171
    s->start_time = 0;
172
    s->duration = (int64_t)wc->samples * AV_TIME_BASE / st->codec->sample_rate;
171
    st->start_time = 0;
172
    st->duration = wc->samples;
173 173

  
174 174
    if(!url_is_streamed(s->pb)) {
175 175
        int64_t cur = url_ftell(s->pb);

Also available in: Unified diff