summaryrefslogtreecommitdiff
path: root/libavcodec/mmvideo.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mmvideo.c')
-rw-r--r--libavcodec/mmvideo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index c61cd576e4..3b780eec50 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -34,6 +34,7 @@
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "bytestream.h"
+#include "internal.h"
#define MM_PREAMBLE_SIZE 6
@@ -61,8 +62,6 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_PAL8;
avcodec_get_frame_defaults(&s->frame);
- s->frame.reference = 3;
-
return 0;
}
@@ -188,7 +187,7 @@ static int mm_decode_frame(AVCodecContext *avctx,
buf_size -= MM_PREAMBLE_SIZE;
bytestream2_init(&s->gb, buf, buf_size);
- if ((res = avctx->reget_buffer(avctx, &s->frame)) < 0) {
+ if ((res = ff_reget_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return res;
}
@@ -210,8 +209,10 @@ static int mm_decode_frame(AVCodecContext *avctx,
memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE);
+ if ((res = av_frame_ref(data, &s->frame)) < 0)
+ return res;
+
*got_frame = 1;
- *(AVFrame*)data = s->frame;
return avpkt->size;
}
@@ -220,8 +221,7 @@ static av_cold int mm_decode_end(AVCodecContext *avctx)
{
MmContext *s = avctx->priv_data;
- if(s->frame.data[0])
- avctx->release_buffer(avctx, &s->frame);
+ av_frame_unref(&s->frame);
return 0;
}