diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-17 00:11:33 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-07 03:30:57 +0100 |
commit | 572ccbd299f0aeb3c7f9661752bd111497f08166 (patch) | |
tree | 4c1704739bdfcbf9b1a43035840b2a1d65790d3a /libavcodec/a64multienc.c | |
parent | dcf0f82d08e88ea952aa97c16e4e774ce6c2ceb8 (diff) | |
download | android_external_ffmpeg-572ccbd299f0aeb3c7f9661752bd111497f08166.tar.gz android_external_ffmpeg-572ccbd299f0aeb3c7f9661752bd111497f08166.tar.bz2 android_external_ffmpeg-572ccbd299f0aeb3c7f9661752bd111497f08166.zip |
Merge commit '6139f481ac9feb1bee4e7d04789fb15d7f24ebbf'
* commit '6139f481ac9feb1bee4e7d04789fb15d7f24ebbf':
asvenc: use the AVFrame API properly.
a64multienc: use the AVFrame API properly.
Conflicts:
libavcodec/vaapi_mpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc4a6435638fa2a471fef048a3e68eaf7e6e306c)
Author of the merged code: Anton Khirnov
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/a64multienc.c')
-rw-r--r-- | libavcodec/a64multienc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c index e5c0fa782f..d692ebfdef 100644 --- a/libavcodec/a64multienc.c +++ b/libavcodec/a64multienc.c @@ -40,9 +40,6 @@ #define C64YRES 200 typedef struct A64Context { - /* general variables */ - AVFrame picture; - /* variables for multicolor modes */ AVLFG randctx; int mc_lifetime; @@ -189,6 +186,7 @@ static void render_charset(AVCodecContext *avctx, uint8_t *charset, static av_cold int a64multi_close_encoder(AVCodecContext *avctx) { A64Context *c = avctx->priv_data; + av_frame_free(&avctx->coded_frame); av_free(c->mc_meta_charset); av_free(c->mc_best_cb); av_free(c->mc_charset); @@ -240,8 +238,12 @@ static av_cold int a64multi_init_encoder(AVCodecContext *avctx) AV_WB32(avctx->extradata, c->mc_lifetime); AV_WB32(avctx->extradata + 16, INTERLACED); - avcodec_get_frame_defaults(&c->picture); - avctx->coded_frame = &c->picture; + avctx->coded_frame = av_frame_alloc(); + if (!avctx->coded_frame) { + a64multi_close_encoder(avctx); + return AVERROR(ENOMEM); + } + avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I; avctx->coded_frame->key_frame = 1; if (!avctx->codec_tag) @@ -271,7 +273,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) { A64Context *c = avctx->priv_data; - AVFrame *const p = &c->picture; + AVFrame *const p = avctx->coded_frame; int frame; int x, y; |