@ -26,6 +26,7 @@
# include "xface.h"
# include "xface.h"
# include "avcodec.h"
# include "avcodec.h"
# include "encode.h"
# include "internal.h"
# include "internal.h"
# include "libavutil/avassert.h"
# include "libavutil/avassert.h"
@ -195,7 +196,7 @@ static int xface_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
intbuf [ i + + ] = r + XFACE_FIRST_PRINT ;
intbuf [ i + + ] = r + XFACE_FIRST_PRINT ;
}
}
if ( ( ret = ff_alloc_packet2 ( avctx , pkt , i + 2 , 0 ) ) < 0 )
if ( ( ret = ff_get_encode_buffer ( avctx , pkt , i + 2 , 0 ) ) < 0 )
return ret ;
return ret ;
/* revert the number, and close the buffer */
/* revert the number, and close the buffer */
@ -216,6 +217,7 @@ const AVCodec ff_xface_encoder = {
. long_name = NULL_IF_CONFIG_SMALL ( " X-face image " ) ,
. long_name = NULL_IF_CONFIG_SMALL ( " X-face image " ) ,
. type = AVMEDIA_TYPE_VIDEO ,
. type = AVMEDIA_TYPE_VIDEO ,
. id = AV_CODEC_ID_XFACE ,
. id = AV_CODEC_ID_XFACE ,
. capabilities = AV_CODEC_CAP_DR1 ,
. priv_data_size = sizeof ( XFaceContext ) ,
. priv_data_size = sizeof ( XFaceContext ) ,
. encode2 = xface_encode_frame ,
. encode2 = xface_encode_frame ,
. pix_fmts = ( const enum AVPixelFormat [ ] ) { AV_PIX_FMT_MONOWHITE , AV_PIX_FMT_NONE } ,
. pix_fmts = ( const enum AVPixelFormat [ ] ) { AV_PIX_FMT_MONOWHITE , AV_PIX_FMT_NONE } ,