[FFmpeg-cvslog] r20295 - trunk/libavfilter/avfilter.c

vitor subversion
Mon Oct 19 00:33:38 CEST 2009


Author: vitor
Date: Mon Oct 19 00:33:37 2009
New Revision: 20295

Log:
Fix recursive avfilter_poll_frame(). It was doing
min = FFMIN(min, avfilter_poll_frame(link->src->inputs[i]))
which, since FFMIN is a macro, was calling itself
twice for every input, causing an exponential cost in time.

Modified:
   trunk/libavfilter/avfilter.c

Modified: trunk/libavfilter/avfilter.c
==============================================================================
--- trunk/libavfilter/avfilter.c	Sun Oct 18 23:44:03 2009	(r20294)
+++ trunk/libavfilter/avfilter.c	Mon Oct 19 00:33:37 2009	(r20295)
@@ -224,9 +224,11 @@ int avfilter_poll_frame(AVFilterLink *li
         return link_spad(link).poll_frame(link);
 
     for (i=0; i<link->src->input_count; i++) {
+        int val;
         if(!link->src->inputs[i])
             return -1;
-        min = FFMIN(min, avfilter_poll_frame(link->src->inputs[i]));
+        val = avfilter_poll_frame(link->src->inputs[i]);
+        min = FFMIN(min, val);
     }
 
     return min;



More information about the ffmpeg-cvslog mailing list