Browse Source

libavutil/fifo: Fix fifo grow step

Fifo was reallocating always to twice of the requested size.
This fixes it to reallocate to requested size, or twice of the
original size - whichever is greater.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.1
Jan Sebechlebsky Michael Niedermayer 9 years ago
parent
commit
0e84eee719
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavutil/fifo.c

+ 1
- 1
libavutil/fifo.c View File

@@ -113,7 +113,7 @@ int av_fifo_grow(AVFifoBuffer *f, unsigned int size)
size += av_fifo_size(f); size += av_fifo_size(f);


if (old_size < size) if (old_size < size)
return av_fifo_realloc2(f, FFMAX(size, 2*size));
return av_fifo_realloc2(f, FFMAX(size, 2*old_size));
return 0; return 0;
} }




Loading…
Cancel
Save