audio pts fix

Originally committed as revision 2689 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 21 years ago
parent e6c0297f1c
commit 0a61ba5869
  1. 4
      libavformat/avidec.c

@ -419,7 +419,11 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
ast = st->priv_data; ast = st->priv_data;
/* XXX: how to handle B frames in avi ? */ /* XXX: how to handle B frames in avi ? */
if(st->codec.codec_type == CODEC_TYPE_VIDEO)
pkt->pts = ((int64_t)ast->frame_offset * ast->scale* AV_TIME_BASE) / ast->rate; 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; pkt->stream_index = n;
/* FIXME: We really should read index for that */ /* FIXME: We really should read index for that */
if (st->codec.codec_type == CODEC_TYPE_VIDEO) { if (st->codec.codec_type == CODEC_TYPE_VIDEO) {

Loading…
Cancel
Save