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/indeo3.c | |
parent | 6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff) | |
download | ffmpeg-759001c534287a96dc96d1e274665feb7059145d.tar.gz |
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/indeo3.c')
-rw-r--r-- | libavcodec/indeo3.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 22f5e7916b..e519361aa2 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -81,7 +81,6 @@ typedef struct Cell { typedef struct Indeo3DecodeContext { AVCodecContext *avctx; - AVFrame frame; DSPContext dsp; GetBitContext gb; @@ -1034,6 +1033,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, Indeo3DecodeContext *ctx = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; + AVFrame *frame = data; int res; res = decode_frame_headers(ctx, avctx, buf, buf_size); @@ -1070,27 +1070,22 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, if ((res = decode_plane(ctx, avctx, &ctx->planes[2], ctx->v_data_ptr, ctx->v_data_size, 10))) return res; - if (ctx->frame.data[0]) - avctx->release_buffer(avctx, &ctx->frame); - - ctx->frame.reference = 0; - if ((res = ff_get_buffer(avctx, &ctx->frame)) < 0) { + if ((res = ff_get_buffer(avctx, frame, 0)) < 0) { av_log(ctx->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return res; } output_plane(&ctx->planes[0], ctx->buf_sel, - ctx->frame.data[0], ctx->frame.linesize[0], + frame->data[0], frame->linesize[0], avctx->height); output_plane(&ctx->planes[1], ctx->buf_sel, - ctx->frame.data[1], ctx->frame.linesize[1], + frame->data[1], frame->linesize[1], (avctx->height + 3) >> 2); output_plane(&ctx->planes[2], ctx->buf_sel, - ctx->frame.data[2], ctx->frame.linesize[2], + frame->data[2], frame->linesize[2], (avctx->height + 3) >> 2); *got_frame = 1; - *(AVFrame*)data = ctx->frame; return buf_size; } @@ -1098,13 +1093,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, static av_cold int decode_close(AVCodecContext *avctx) { - Indeo3DecodeContext *ctx = avctx->priv_data; - free_frame_buffers(avctx->priv_data); - if (ctx->frame.data[0]) - avctx->release_buffer(avctx, &ctx->frame); - return 0; } |