aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorMaksym Veremeyenko <verem@m1stereo.tv>2009-09-09 16:26:24 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2009-09-09 16:26:24 +0000
commit2c14ded3869b8342cea49562cdc2483ec4dc6070 (patch)
tree86b3c64c6f3af9bd6a6abc55935ac231564f9af9 /libavformat/avidec.c
parentb60de406a4c109c1369eb573719c1f2f4ab9cd4a (diff)
downloadffmpeg-2c14ded3869b8342cea49562cdc2483ec4dc6070.tar.gz
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
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 0881ca5173..6f2bad170e 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -679,12 +679,18 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
AVStream *st = s->streams[i];
AVIStream *ast = st->priv_data;
int64_t ts= ast->frame_offset;
+ int64_t last_ts;
if(!st->nb_index_entries)
continue;
if(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);
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d/%d %"PRId64"\n", ts, st->time_base.num, st->time_base.den, ast->frame_offset);