summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/ape.c4
-rw-r--r--libavformat/mpc.c4
-rw-r--r--libavformat/wv.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index cc2e657b99..a881138431 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -310,8 +310,8 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
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 --git a/libavformat/mpc.c b/libavformat/mpc.c
index ea6e3c6460..253a900f56 100644
--- a/libavformat/mpc.c
+++ b/libavformat/mpc.c
@@ -115,8 +115,8 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap)
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 --git a/libavformat/wv.c b/libavformat/wv.c
index 9809b37a15..6290a99412 100644
--- a/libavformat/wv.c
+++ b/libavformat/wv.c
@@ -168,8 +168,8 @@ static int wv_read_header(AVFormatContext *s,
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);