From 759001c534287a96dc96d1e274665feb7059145d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 21 Nov 2012 21:34:46 +0100 Subject: lavc decoders: work with refcounted frames. --- libavcodec/avs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libavcodec/avs.c') diff --git a/libavcodec/avs.c b/libavcodec/avs.c index 71b8b0c283..45cb4484d6 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -21,6 +21,7 @@ #include "avcodec.h" #include "get_bits.h" +#include "internal.h" typedef struct { @@ -59,11 +60,10 @@ avs_decode_frame(AVCodecContext * avctx, AvsBlockType type; GetBitContext change_map; - if ((ret = avctx->reget_buffer(avctx, p)) < 0) { + if ((ret = ff_reget_buffer(avctx, p)) < 0) { av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); return ret; } - p->reference = 1; p->pict_type = AV_PICTURE_TYPE_P; p->key_frame = 0; @@ -149,7 +149,8 @@ avs_decode_frame(AVCodecContext * avctx, align_get_bits(&change_map); } - *picture = avs->picture; + if ((ret = av_frame_ref(picture, &avs->picture)) < 0) + return ret; *got_frame = 1; return buf_size; @@ -165,8 +166,7 @@ static av_cold int avs_decode_init(AVCodecContext * avctx) static av_cold int avs_decode_end(AVCodecContext *avctx) { AvsContext *s = avctx->priv_data; - if (s->picture.data[0]) - avctx->release_buffer(avctx, &s->picture); + av_frame_unref(&s->picture); return 0; } -- cgit v1.2.3