aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/v210dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/v210dec.c')
-rw-r--r--libavcodec/v210dec.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index 132b42ad97..42e25cc017 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -60,10 +60,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
avctx->bits_per_raw_sample = 10;
- avctx->coded_frame = avcodec_alloc_frame();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
s->unpack_frame = v210_planar_unpack_c;
if (HAVE_MMX)
@@ -78,7 +74,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
V210DecContext *s = avctx->priv_data;
int h, w, ret, stride, aligned_input;
- AVFrame *pic = avctx->coded_frame;
+ AVFrame *pic = data;
const uint8_t *psrc = avpkt->data;
uint16_t *y, *u, *v;
@@ -108,11 +104,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
v210_x86_init(s);
}
- if (pic->data[0])
- avctx->release_buffer(avctx, pic);
-
- pic->reference = 0;
- if ((ret = ff_get_buffer(avctx, pic)) < 0)
+ if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
return ret;
y = (uint16_t*)pic->data[0];
@@ -155,21 +147,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
}
*got_frame = 1;
- *(AVFrame*)data = *avctx->coded_frame;
return avpkt->size;
}
-static av_cold int decode_close(AVCodecContext *avctx)
-{
- AVFrame *pic = avctx->coded_frame;
- if (pic->data[0])
- avctx->release_buffer(avctx, pic);
- av_freep(&avctx->coded_frame);
-
- return 0;
-}
-
#define V210DEC_FLAGS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM
static const AVOption v210dec_options[] = {
{"custom_stride", "Custom V210 stride", offsetof(V210DecContext, custom_stride), FF_OPT_TYPE_INT,
@@ -190,7 +171,6 @@ AVCodec ff_v210_decoder = {
.id = AV_CODEC_ID_V210,
.priv_data_size = sizeof(V210DecContext),
.init = decode_init,
- .close = decode_close,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"),