#include "avcodec.h"
#include "get_bits.h"
+#include "internal.h"
typedef struct {
AvsBlockType type;
GetBitContext change_map;
- if ((ret = avctx->reget_buffer(avctx, p)) < 0) {
+ if ((ret = ff_reget_buffer(avctx, p)) < 0) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
}
- p->reference = 1;
p->pict_type = AV_PICTURE_TYPE_P;
p->key_frame = 0;
align_get_bits(&change_map);
}
- *picture = avs->picture;
+ if ((ret = av_frame_ref(picture, &avs->picture)) < 0)
+ return ret;
*got_frame = 1;
return buf_size;
static av_cold int avs_decode_init(AVCodecContext * avctx)
{
+ AvsContext *s = avctx->priv_data;
avctx->pix_fmt = AV_PIX_FMT_PAL8;
avcodec_set_dimensions(avctx, 318, 198);
+ avcodec_get_frame_defaults(&s->picture);
return 0;
}
static av_cold int avs_decode_end(AVCodecContext *avctx)
{
AvsContext *s = avctx->priv_data;
- if (s->picture.data[0])
- avctx->release_buffer(avctx, &s->picture);
+ av_frame_unref(&s->picture);
return 0;
}