1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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
This commit is contained in:
Maksym Veremeyenko 2009-09-09 16:25:12 +00:00 committed by Carl Eugen Hoyos
parent 0e1baedec3
commit b60de406a4

View File

@ -680,12 +680,15 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
AVIStream *ast = st->priv_data; AVIStream *ast = st->priv_data;
int64_t ts= ast->frame_offset; int64_t ts= ast->frame_offset;
if(!st->nb_index_entries)
continue;
if(ast->sample_size) if(ast->sample_size)
ts /= ast->sample_size; ts /= ast->sample_size;
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);
if(ts < best_ts && st->nb_index_entries){ if(ts < best_ts){
best_ts= ts; best_ts= ts;
best_st= st; best_st= st;
best_stream_index= i; best_stream_index= i;