diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-01-10 23:55:57 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-01-10 23:55:57 +0000 |
commit | 0a61ba5869b0ef293f46b19c27d50b5c904a4ad5 (patch) | |
tree | fba0499f11c1852850efbe60f0fe7db2559a24d1 | |
parent | e6c0297f1ca2234477aafc62e76a6428c56595d7 (diff) | |
download | ffmpeg-0a61ba5869b0ef293f46b19c27d50b5c904a4ad5.tar.gz |
audio pts fix
Originally committed as revision 2689 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/avidec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 361a52ff36..0d36099337 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -419,7 +419,11 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) ast = st->priv_data; /* XXX: how to handle B frames in avi ? */ - pkt->pts = ((int64_t)ast->frame_offset * ast->scale* AV_TIME_BASE) / ast->rate; + if(st->codec.codec_type == CODEC_TYPE_VIDEO) + pkt->pts = ((int64_t)ast->frame_offset * ast->scale* AV_TIME_BASE) / ast->rate; + else //FIXME this is proably not correct for all weird avis + pkt->pts = ((int64_t)ast->frame_offset * ast->scale* AV_TIME_BASE) / (ast->rate * st->codec.block_align); +//printf("%Ld %d %d %d %d\n", pkt->pts, ast->frame_offset, ast->scale, AV_TIME_BASE, ast->rate); pkt->stream_index = n; /* FIXME: We really should read index for that */ if (st->codec.codec_type == CODEC_TYPE_VIDEO) { |