Commit ec7f1cd4 authored by michael's avatar michael

audio pts fix


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2689 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 6fd286a1
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment