diff ape.c @ 5566:28094e9bd013 libavformat

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.
author conrad
date Thu, 21 Jan 2010 09:47:02 +0000
parents 6c0318c8a127
children 134741dc8327
line wrap: on
line diff
--- 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);