summaryrefslogtreecommitdiff
path: root/libavcodec/mss3.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/mss3.c')
-rw-r--r--libavcodec/mss3.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
index d5bb2d4e35..089b722e48 100644
--- a/libavcodec/mss3.c
+++ b/libavcodec/mss3.c
@@ -27,6 +27,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "dsputil.h"
+#include "internal.h"
#include "mss34dsp.h"
#define HEADER_SIZE 27
@@ -730,18 +731,16 @@ static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return buf_size;
c->got_error = 0;
- c->pic.reference = 3;
- c->pic.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE |
- FF_BUFFER_HINTS_REUSABLE;
- if ((ret = avctx->reget_buffer(avctx, &c->pic)) < 0) {
+ if ((ret = ff_reget_buffer(avctx, &c->pic)) < 0) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
}
c->pic.key_frame = keyframe;
c->pic.pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
if (!bytestream2_get_bytes_left(&gb)) {
+ if ((ret = av_frame_ref(data, &c->pic)) < 0)
+ return ret;
*got_frame = 1;
- *(AVFrame*)data = c->pic;
return buf_size;
}
@@ -798,8 +797,10 @@ static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
dst[2] += c->pic.linesize[2] * 8;
}
+ if ((ret = av_frame_ref(data, &c->pic)) < 0)
+ return ret;
+
*got_frame = 1;
- *(AVFrame*)data = c->pic;
return buf_size;
}
@@ -836,7 +837,6 @@ static av_cold int mss3_decode_init(AVCodecContext *avctx)
}
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
- avctx->coded_frame = &c->pic;
init_coders(c);
@@ -848,8 +848,7 @@ static av_cold int mss3_decode_end(AVCodecContext *avctx)
MSS3Context * const c = avctx->priv_data;
int i;
- if (c->pic.data[0])
- avctx->release_buffer(avctx, &c->pic);
+ av_frame_unref(&c->pic);
for (i = 0; i < 3; i++)
av_freep(&c->dct_coder[i].prev_dc);