changeset 5166:1258b5879021 libavformat

Factorise st->nb_index_entries check. Patch by Maksym Veremeyenko, verem m1stereo tv
author cehoyos
date Wed, 09 Sep 2009 16:25:12 +0000
parents 3d4203b9c2d7
children 00fcfe0596e8
files avidec.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/avidec.c	Mon Sep 07 22:42:51 2009 +0000
+++ b/avidec.c	Wed Sep 09 16:25:12 2009 +0000
@@ -680,12 +680,15 @@
             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;