diff options
author | Anton Khirnov | 2012-11-21 21:34:46 +0100 |
---|---|---|
committer | Anton Khirnov | 2013-03-08 07:38:30 +0100 |
commit | 759001c534287a96dc96d1e274665feb7059145d (patch) | |
tree | 6ace9560c20aa30db92067c5b45d7bd86e458d10 /libavcodec/ulti.c | |
parent | 6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff) |
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/ulti.c')
-rw-r--r-- | libavcodec/ulti.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index 275319605d..e99c26725b 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -30,6 +30,7 @@ #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "ulti_cb.h" @@ -60,8 +61,7 @@ static av_cold int ulti_decode_end(AVCodecContext *avctx){ UltimotionDecodeContext *s = avctx->priv_data; AVFrame *pic = &s->frame; - if (pic->data[0]) - avctx->release_buffer(avctx, pic); + av_frame_unref(pic); return 0; } @@ -221,15 +221,13 @@ static int ulti_decode_frame(AVCodecContext *avctx, int blocks = 0; int done = 0; int x = 0, y = 0; - int i; + int i, ret; int skip; int tmp; - s->frame.reference = 1; - s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; - if (avctx->reget_buffer(avctx, &s->frame) < 0) { + if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); - return -1; + return ret; } bytestream2_init(&s->gb, buf, buf_size); @@ -407,7 +405,8 @@ static int ulti_decode_frame(AVCodecContext *avctx, } *got_frame = 1; - *(AVFrame*)data= s->frame; + if ((ret = av_frame_ref(data, &s->frame)) < 0) + return ret; return buf_size; |