Fix a bug with reading non-interleaved AVI if one the streams is

shorter.

Patch by Maksym Veremeyenko, verem m1stereo tv

Originally committed as revision 19798 to svn://svn.ffmpeg.org/ffmpeg/trunk
release/0.6
Maksym Veremeyenko 16 years ago committed by Carl Eugen Hoyos
parent b60de406a4
commit 2c14ded386
  1. 6
      libavformat/avidec.c

@ -679,12 +679,18 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
AVStream *st = s->streams[i]; AVStream *st = s->streams[i];
AVIStream *ast = st->priv_data; AVIStream *ast = st->priv_data;
int64_t ts= ast->frame_offset; int64_t ts= ast->frame_offset;
int64_t last_ts;
if(!st->nb_index_entries) if(!st->nb_index_entries)
continue; continue;
if(ast->sample_size) if(ast->sample_size)
ts /= ast->sample_size; ts /= ast->sample_size;
last_ts = st->index_entries[st->nb_index_entries - 1].timestamp;
if(!ast->remaining && ts > last_ts)
continue;
ts = av_rescale_q(ts, st->time_base, AV_TIME_BASE_Q); ts = av_rescale_q(ts, st->time_base, AV_TIME_BASE_Q);
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d/%d %"PRId64"\n", ts, st->time_base.num, st->time_base.den, ast->frame_offset); // av_log(s, AV_LOG_DEBUG, "%"PRId64" %d/%d %"PRId64"\n", ts, st->time_base.num, st->time_base.den, ast->frame_offset);

Loading…
Cancel
Save