summaryrefslogtreecommitdiff
path: root/libavcodec/v408dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/v408dec.c')
-rw-r--r--libavcodec/v408dec.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/libavcodec/v408dec.c b/libavcodec/v408dec.c
index 470853d551..b295d4abdf 100644
--- a/libavcodec/v408dec.c
+++ b/libavcodec/v408dec.c
@@ -26,35 +26,23 @@ static av_cold int v408_decode_init(AVCodecContext *avctx)
{
avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
- avctx->coded_frame = avcodec_alloc_frame();
-
- if (!avctx->coded_frame) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate frame.\n");
- return AVERROR(ENOMEM);
- }
-
return 0;
}
static int v408_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
- AVFrame *pic = avctx->coded_frame;
+ AVFrame *pic = data;
const uint8_t *src = avpkt->data;
uint8_t *y, *u, *v, *a;
int i, j;
- if (pic->data[0])
- avctx->release_buffer(avctx, pic);
-
if (avpkt->size < 4 * avctx->height * avctx->width) {
av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n");
return AVERROR(EINVAL);
}
- pic->reference = 0;
-
- if (ff_get_buffer(avctx, pic) < 0) {
+ if (ff_get_buffer(avctx, pic, 0) < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
return AVERROR(ENOMEM);
}
@@ -89,17 +77,12 @@ static int v408_decode_frame(AVCodecContext *avctx, void *data,
}
*got_frame = 1;
- *(AVFrame *)data = *pic;
return avpkt->size;
}
static av_cold int v408_decode_close(AVCodecContext *avctx)
{
- if (avctx->coded_frame->data[0])
- avctx->release_buffer(avctx, avctx->coded_frame);
-
- av_freep(&avctx->coded_frame);
return 0;
}