diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-14 01:36:40 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-14 01:42:51 +0200 |
commit | 555e2921ddc48e84ce8890662c3b7fcd0594a45e (patch) | |
tree | 9b2b6dd90e32423e874092dfa03b4cf273099fd9 /libavcodec/flac_parser.c | |
parent | 5edd4fce409c1724a0916f14a78964b0f168bae3 (diff) | |
download | ffmpeg-555e2921ddc48e84ce8890662c3b7fcd0594a45e.tar.gz |
flac_parser: speedup fifo realloc
Fixes Ticket1121
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/flac_parser.c')
-rw-r--r-- | libavcodec/flac_parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c index 217461f828..3d2b88262f 100644 --- a/libavcodec/flac_parser.c +++ b/libavcodec/flac_parser.c @@ -561,8 +561,8 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx, } /* Fill the buffer. */ - if (av_fifo_realloc2(fpc->fifo_buf, - (read_end - read_start) + av_fifo_size(fpc->fifo_buf)) < 0) { + if ( av_fifo_space(fpc->fifo_buf) < read_end - read_start + && av_fifo_realloc2(fpc->fifo_buf, (read_end - read_start) + 2*av_fifo_size(fpc->fifo_buf)) < 0) { av_log(avctx, AV_LOG_ERROR, "couldn't reallocate buffer of size %td\n", (read_end - read_start) + av_fifo_size(fpc->fifo_buf)); |