#include "avcodec.h"
#include "get_bits.h"
#include "indeo2data.h"
+#include "internal.h"
#include "mathops.h"
typedef struct Ir2Context{
AVFrame * const p = &s->picture;
int start, ret;
- if (p->data[0])
- avctx->release_buffer(avctx, p);
-
- p->reference = 1;
- p->buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if ((ret = avctx->reget_buffer(avctx, p)) < 0) {
+ if ((ret = ff_reget_buffer(avctx, p)) < 0) {
av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
}
return ret;
}
- *picture = s->picture;
+ if ((ret = av_frame_ref(picture, &s->picture)) < 0)
+ return ret;
+
*got_frame = 1;
return buf_size;
avctx->pix_fmt= AV_PIX_FMT_YUV410P;
+ avcodec_get_frame_defaults(&ic->picture);
+
ir2_vlc.table = vlc_tables;
ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;
#ifdef BITSTREAM_READER_LE
Ir2Context * const ic = avctx->priv_data;
AVFrame *pic = &ic->picture;
- if (pic->data[0])
- avctx->release_buffer(avctx, pic);
+ av_frame_unref(pic);
return 0;
}