summaryrefslogtreecommitdiff
path: root/libavformat/ape.c
diff options
context:
space:
mode:
authorjamal <jamrial@gmail.com>2012-08-22 23:53:08 -0300
committerMichael Niedermayer <michaelni@gmx.at>2012-08-23 15:51:51 +0200
commit732dfc7660105cddbccdf9f3bc6f6adca8cc8e37 (patch)
treee5bb456ebc751bf4cbedc4a04a8146105d7737ae /libavformat/ape.c
parent599a4e07711b4a950bf13de707cfd011d90ad5a5 (diff)
downloadffmpeg-732dfc7660105cddbccdf9f3bc6f6adca8cc8e37.tar.gz
lavf/ape: Fix stream duration calculation
Fixes ticket #1662 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/ape.c')
-rw-r--r--libavformat/ape.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 547a9c01e6..c4a390b4fd 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -38,8 +38,6 @@
#define MAC_FORMAT_FLAG_HAS_SEEK_ELEMENTS 16 // has the number of seek elements after the peak level
#define MAC_FORMAT_FLAG_CREATE_WAV_HEADER 32 // create the wave header on decompression (not stored)
-#define MAC_SUBFRAME_SIZE 4608
-
#define APE_EXTRADATA_SIZE 6
typedef struct {
@@ -335,8 +333,8 @@ static int ape_read_header(AVFormatContext * s)
st->nb_frames = ape->totalframes;
st->start_time = 0;
- st->duration = total_blocks / MAC_SUBFRAME_SIZE;
- avpriv_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate);
+ st->duration = total_blocks;
+ avpriv_set_pts_info(st, 64, 1, ape->samplerate);
st->codec->extradata = av_malloc(APE_EXTRADATA_SIZE);
st->codec->extradata_size = APE_EXTRADATA_SIZE;
@@ -348,7 +346,7 @@ static int ape_read_header(AVFormatContext * s)
for (i = 0; i < ape->totalframes; i++) {
ape->frames[i].pts = pts;
av_add_index_entry(st, ape->frames[i].pos, ape->frames[i].pts, 0, 0, AVINDEX_KEYFRAME);
- pts += ape->blocksperframe / MAC_SUBFRAME_SIZE;
+ pts += ape->blocksperframe;
}
/* try to read APE tags */