[FFmpeg-devel] [PATCH] avcodec: add bink2 video decoder

James Almer jamrial at gmail.com
Fri Mar 20 16:08:00 EET 2020


On 3/20/2020 10:31 AM, Paul B Mahol wrote:
> +static av_cold int bink2_decode_end(AVCodecContext *avctx)
> +{
> +    Bink2Context * const c = avctx->priv_data;
> +
> +    av_frame_free(&c->last);
> +    av_freep(&c->current_q);
> +    av_freep(&c->prev_q);
> +    av_freep(&c->current_dc);
> +    av_freep(&c->prev_dc);
> +    av_freep(&c->current_idc);
> +    av_freep(&c->prev_idc);
> +    av_freep(&c->current_mv);
> +    av_freep(&c->prev_mv);
> +    av_freep(&c->col_cbp);
> +    av_freep(&c->row_cbp);
> +
> +    return 0;
> +}
> +
> +AVCodec ff_bink2_decoder = {
> +    .name           = "binkvideo2",
> +    .long_name      = NULL_IF_CONFIG_SMALL("Bink video 2"),
> +    .type           = AVMEDIA_TYPE_VIDEO,
> +    .id             = AV_CODEC_ID_BINKVIDEO2,
> +    .priv_data_size = sizeof(Bink2Context),
> +    .init           = bink2_decode_init,
> +    .close          = bink2_decode_end,
> +    .decode         = bink2_decode_frame,
> +    .capabilities   = AV_CODEC_CAP_DR1,
> +};

Missing a flush() callback unreffing c->last, and probably also zeroing
some of the above arrays.


More information about the ffmpeg-devel mailing list