# HG changeset patch # User conrad # Date 1264067222 0 # Node ID 28094e9bd013b4ea09bfcf78b60777a5723ec951 # Parent befe2f0f9a005ccaab327fb355196a367b9bc009 Set start_time and duration in AVStream instead of AVFormatContext for formats with only one stream; the AVFormatContext values will be derived from the AVStream and this helps in calculating stream bitrate. diff -r befe2f0f9a00 -r 28094e9bd013 ape.c --- a/ape.c Wed Jan 20 17:26:14 2010 +0000 +++ b/ape.c Thu Jan 21 09:47:02 2010 +0000 @@ -310,8 +310,8 @@ st->codec->frame_size = MAC_SUBFRAME_SIZE; st->nb_frames = ape->totalframes; - s->start_time = 0; - s->duration = (int64_t) total_blocks * AV_TIME_BASE / ape->samplerate; + st->start_time = 0; + st->duration = total_blocks / MAC_SUBFRAME_SIZE; av_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate); st->codec->extradata = av_malloc(APE_EXTRADATA_SIZE); diff -r befe2f0f9a00 -r 28094e9bd013 mpc.c --- a/mpc.c Wed Jan 20 17:26:14 2010 +0000 +++ b/mpc.c Thu Jan 21 09:47:02 2010 +0000 @@ -115,8 +115,8 @@ st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3]; av_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate); /* scan for seekpoints */ - s->start_time = 0; - s->duration = (int64_t)c->fcount * MPC_FRAMESIZE * AV_TIME_BASE / st->codec->sample_rate; + st->start_time = 0; + st->duration = c->fcount; /* try to read APE tags */ if (!url_is_streamed(s->pb)) { diff -r befe2f0f9a00 -r 28094e9bd013 wv.c --- a/wv.c Wed Jan 20 17:26:14 2010 +0000 +++ b/wv.c Thu Jan 21 09:47:02 2010 +0000 @@ -168,8 +168,8 @@ st->codec->sample_rate = wc->rate; st->codec->bits_per_coded_sample = wc->bpp; av_set_pts_info(st, 64, 1, wc->rate); - s->start_time = 0; - s->duration = (int64_t)wc->samples * AV_TIME_BASE / st->codec->sample_rate; + st->start_time = 0; + st->duration = wc->samples; if(!url_is_streamed(s->pb)) { int64_t cur = url_ftell(s->pb);