[FFmpeg-cvslog] avcodec/utils: do not use internal-> byte_buffer when little downsizing is expected

Michael Niedermayer git at videolan.org
Mon Jul 27 20:19:12 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Jul 27 20:01:59 2015 +0200| [9fe873bec8b6d342064cf282b0ba09f91ac9292f] | committer: Michael Niedermayer

avcodec/utils: do not use internal->byte_buffer when little downsizing is expected

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9fe873bec8b6d342064cf282b0ba09f91ac9292f
---

 libavcodec/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b147559..42d509e 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1789,7 +1789,7 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64
         return AVERROR(EINVAL);
     }
 
-    if (avctx) {
+    if (avctx && 2*min_size < size) { // FIXME The factor needs to be finetuned
         av_assert0(!avpkt->data || avpkt->data != avctx->internal->byte_buffer);
         if (!avpkt->data || avpkt->size < size) {
             av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);



More information about the ffmpeg-cvslog mailing list