summaryrefslogtreecommitdiff
path: root/libavcodec/libxvid.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-11-09 10:14:46 +0100
committerAnton Khirnov <anton@khirnov.net>2013-11-16 17:50:09 +0100
commitffe04c330335add4c6d70ab0bb98e6b3f4f7abfa (patch)
tree689e84de710c9b978a1d6ea6786c2dd5f0fc3def /libavcodec/libxvid.c
parent863a670e483daaf7c4646e4636d56ac25b539c8f (diff)
libxvid: use the AVFrame API properly.
Diffstat (limited to 'libavcodec/libxvid.c')
-rw-r--r--libavcodec/libxvid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 9a07207e3e..fe68c8ebcc 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -54,7 +54,6 @@ struct xvid_context {
int me_flags; /**< Motion Estimation flags */
int qscale; /**< Do we use constant scale? */
int quicktime_format; /**< Are we in a QT-based format? */
- AVFrame encoded_picture; /**< Encoded frame information */
char *twopassbuffer; /**< Character buffer for two-pass */
char *old_twopassbuffer; /**< Old character buffer (two-pass) */
char *twopassfile; /**< second pass temp file name */
@@ -606,7 +605,9 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) {
}
x->encoder_handle = xvid_enc_create.handle;
- avctx->coded_frame = &x->encoded_picture;
+ avctx->coded_frame = av_frame_alloc();
+ if (!avctx->coded_frame)
+ return AVERROR(ENOMEM);
return 0;
}
@@ -617,7 +618,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int xerr, i, ret, user_packet = !!pkt->data;
char *tmp;
struct xvid_context *x = avctx->priv_data;
- AVFrame *p = &x->encoded_picture;
+ AVFrame *p = avctx->coded_frame;
int mb_width = (avctx->width + 15) / 16;
int mb_height = (avctx->height + 15) / 16;
@@ -633,7 +634,6 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
/* Start setting up the frame */
xvid_enc_frame.version = XVID_VERSION;
xvid_enc_stats.version = XVID_VERSION;
- *p = *picture;
/* Let Xvid know where to put the frame. */
xvid_enc_frame.bitstream = pkt->data;