libspeexenc: switch to ff_alloc_packet2().

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-03-22 15:00:47 +01:00
parent bb84112bae
commit f3b10d38d7

View File

@ -267,8 +267,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
/* write output if all frames for the packet have been encoded */
if (s->pkt_frame_count == s->frames_per_packet) {
s->pkt_frame_count = 0;
if ((ret = ff_alloc_packet(avpkt, speex_bits_nbytes(&s->bits)))) {
av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
if ((ret = ff_alloc_packet2(avctx, avpkt, speex_bits_nbytes(&s->bits)))) {
return ret;
}
ret = speex_bits_write(&s->bits, avpkt->data, avpkt->size);