diff options
Diffstat (limited to 'libavcodec/avuidec.c')
-rw-r--r-- | libavcodec/avuidec.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c index 22af719090..689191d2e6 100644 --- a/libavcodec/avuidec.c +++ b/libavcodec/avuidec.c @@ -27,30 +27,19 @@ static av_cold int avui_decode_init(AVCodecContext *avctx) { avctx->pix_fmt = AV_PIX_FMT_YUVA422P; - - 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 avui_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, *extradata = avctx->extradata; const uint8_t *srca; uint8_t *y, *u, *v, *a; int transparent, interlaced = 1, skip, opaque_length, i, j, k; uint32_t extradata_size = avctx->extradata_size; - if (pic->data[0]) - avctx->release_buffer(avctx, pic); - while (extradata_size >= 24) { uint32_t atom_size = AV_RB32(extradata); if (!memcmp(&extradata[4], "APRGAPRG0001", 12)) { @@ -78,9 +67,7 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data, avpkt->size >= opaque_length * 2 + 4; srca = src + opaque_length + 5; - 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); } @@ -129,28 +116,16 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data, srca += 4; } *got_frame = 1; - *(AVFrame *)data = *pic; return avpkt->size; } -static av_cold int avui_decode_close(AVCodecContext *avctx) -{ - if (avctx->coded_frame->data[0]) - avctx->release_buffer(avctx, avctx->coded_frame); - - av_freep(&avctx->coded_frame); - - return 0; -} - AVCodec ff_avui_decoder = { .name = "avui", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_AVUI, .init = avui_decode_init, .decode = avui_decode_frame, - .close = avui_decode_close, .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), }; |