diff options
author | Maksym Veremeyenko <verem@m1stereo.tv> | 2009-09-09 16:25:12 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2009-09-09 16:25:12 +0000 |
commit | b60de406a4c109c1369eb573719c1f2f4ab9cd4a (patch) | |
tree | c3831615a37f0211825118851d25ff7a950a8e9d | |
parent | 0e1baedec302e6d952bc46708753aaa586b33651 (diff) | |
download | ffmpeg-b60de406a4c109c1369eb573719c1f2f4ab9cd4a.tar.gz |
Factorise st->nb_index_entries check.
Patch by Maksym Veremeyenko, verem m1stereo tv
Originally committed as revision 19797 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/avidec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 2175374e6e..0881ca5173 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -680,12 +680,15 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) AVIStream *ast = st->priv_data; int64_t ts= ast->frame_offset; + if(!st->nb_index_entries) + continue; + if(ast->sample_size) ts /= ast->sample_size; 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); - if(ts < best_ts && st->nb_index_entries){ + if(ts < best_ts){ best_ts= ts; best_st= st; best_stream_index= i; |