[FFmpeg-cvslog] snowenc: switch to ff_alloc_packet2()

Michael Niedermayer git at videolan.org
Thu Mar 22 19:10:27 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Mar 22 04:26:59 2012 +0100| [076310edee6e048b8446d8d8c93363546c29e11e] | committer: Michael Niedermayer

snowenc: switch to ff_alloc_packet2()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/snowenc.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 1f31db0..6cddec0 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -22,6 +22,7 @@
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
+#include "internal.h"
 #include "dsputil.h"
 #include "dwt.h"
 #include "snow.h"
@@ -1613,9 +1614,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     uint8_t rc_header_bak[sizeof(s->header_state)];
     uint8_t rc_block_bak[sizeof(s->block_state)];
 
-    if (!pkt->data &&
-        (ret = av_new_packet(pkt, s->b_width*s->b_height*MB_SIZE*MB_SIZE*3 + FF_MIN_BUFFER_SIZE)) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
+    if ((ret = ff_alloc_packet2(avctx, pkt, s->b_width*s->b_height*MB_SIZE*MB_SIZE*3 + FF_MIN_BUFFER_SIZE)) < 0) {
         return ret;
     }
 



More information about the ffmpeg-cvslog mailing list