diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2009-10-18 22:33:37 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2009-10-18 22:33:37 +0000 |
commit | 9dd08b4e1ebc294848e69dd3e1d4eed19ffe5a90 (patch) | |
tree | 4bfb07924671f7140b1ac22e690e0b7e3271750d /libavfilter | |
parent | b07781b6e4f6267f20aec4e7f1d390ddb223af46 (diff) | |
download | ffmpeg-9dd08b4e1ebc294848e69dd3e1d4eed19ffe5a90.tar.gz |
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.
Originally committed as revision 20295 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/avfilter.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 77c7571388..c68afad077 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -224,9 +224,11 @@ int avfilter_poll_frame(AVFilterLink *link) 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; |