[FFmpeg-cvslog] libopusenc: use ff_alloc_packet2

James Zern git at videolan.org
Wed Mar 6 11:35:22 CET 2013


ffmpeg | branch: master | James Zern <jzern at google.com> | Tue Mar  5 13:19:03 2013 -0800| [1811f1d84079b30295725ae69aa14054dbb377ff] | committer: Paul B Mahol

libopusenc: use ff_alloc_packet2

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/libopusenc.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index a4aa37c..04c297d 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -331,10 +331,8 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
     /* Maximum packet size taken from opusenc in opus-tools. 60ms packets
      * consist of 3 frames in one packet. The maximum frame size is 1275
      * bytes along with the largest possible packet header of 7 bytes. */
-    if (ret = ff_alloc_packet(avpkt, (1275 * 3 + 7) * opus->stream_count)) {
-        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
+    if ((ret = ff_alloc_packet2(avctx, avpkt, (1275 * 3 + 7) * opus->stream_count)) < 0)
         return ret;
-    }
 
     if (avctx->sample_fmt == AV_SAMPLE_FMT_FLT)
         ret = opus_multistream_encode_float(opus->enc, (float *)audio,



More information about the ffmpeg-cvslog mailing list