diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-21 21:34:46 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 07:38:30 +0100 |
commit | 759001c534287a96dc96d1e274665feb7059145d (patch) | |
tree | 6ace9560c20aa30db92067c5b45d7bd86e458d10 /libavcodec/indeo2.c | |
parent | 6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff) | |
download | ffmpeg-759001c534287a96dc96d1e274665feb7059145d.tar.gz |
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/indeo2.c')
-rw-r--r-- | libavcodec/indeo2.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 1b4d51b6b1..37b3ea19cd 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -29,6 +29,7 @@ #include "avcodec.h" #include "get_bits.h" #include "indeo2data.h" +#include "internal.h" #include "mathops.h" typedef struct Ir2Context{ @@ -148,12 +149,7 @@ static int ir2_decode_frame(AVCodecContext *avctx, AVFrame * const p = &s->picture; int start, ret; - if (p->data[0]) - avctx->release_buffer(avctx, p); - - p->reference = 1; - p->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; - if ((ret = avctx->reget_buffer(avctx, p)) < 0) { + if ((ret = ff_reget_buffer(avctx, p)) < 0) { av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); return ret; } @@ -206,7 +202,9 @@ static int ir2_decode_frame(AVCodecContext *avctx, return ret; } - *picture = s->picture; + if ((ret = av_frame_ref(picture, &s->picture)) < 0) + return ret; + *got_frame = 1; return buf_size; @@ -241,8 +239,7 @@ static av_cold int ir2_decode_end(AVCodecContext *avctx) Ir2Context * const ic = avctx->priv_data; AVFrame *pic = &ic->picture; - if (pic->data[0]) - avctx->release_buffer(avctx, pic); + av_frame_unref(pic); return 0; } |