diff options
Diffstat (limited to 'libavcodec/loco.c')
-rw-r--r-- | libavcodec/loco.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 2b7116685d..5019e7ad6c 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -45,7 +45,6 @@ enum LOCO_MODE { typedef struct LOCOContext { AVCodecContext *avctx; - AVFrame pic; int lossy; int mode; } LOCOContext; @@ -176,14 +175,10 @@ static int decode_frame(AVCodecContext *avctx, LOCOContext * const l = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - AVFrame * const p = &l->pic; + AVFrame * const p = data; int decoded, ret; - if (p->data[0]) - avctx->release_buffer(avctx, p); - - p->reference = 0; - if ((ret = ff_get_buffer(avctx, p)) < 0) { + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } @@ -247,7 +242,6 @@ static int decode_frame(AVCodecContext *avctx, buf_size -= decoded; *got_frame = 1; - *(AVFrame*)data = l->pic; return avpkt->size - buf_size; buf_too_small: @@ -305,19 +299,6 @@ static av_cold int decode_init(AVCodecContext *avctx) if (avctx->debug & FF_DEBUG_PICT_INFO) av_log(avctx, AV_LOG_INFO, "lossy:%i, version:%i, mode: %i\n", l->lossy, version, l->mode); - avcodec_get_frame_defaults(&l->pic); - - return 0; -} - -static av_cold int decode_end(AVCodecContext *avctx) -{ - LOCOContext * const l = avctx->priv_data; - AVFrame *pic = &l->pic; - - if (pic->data[0]) - avctx->release_buffer(avctx, pic); - return 0; } @@ -327,7 +308,6 @@ AVCodec ff_loco_decoder = { .id = AV_CODEC_ID_LOCO, .priv_data_size = sizeof(LOCOContext), .init = decode_init, - .close = decode_end, .decode = decode_frame, .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("LOCO"), |