aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/motionpixels.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/motionpixels.c')
-rw-r--r--libavcodec/motionpixels.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 4fa45e9c5d..1d5624500b 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -22,6 +22,7 @@
#include "avcodec.h"
#include "get_bits.h"
#include "dsputil.h"
+#include "internal.h"
#define MAX_HUFF_CODES 16
@@ -264,9 +265,7 @@ static int mp_decode_frame(AVCodecContext *avctx,
GetBitContext gb;
int i, count1, count2, sz, ret;
- mp->frame.reference = 3;
- mp->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
- if ((ret = avctx->reget_buffer(avctx, &mp->frame)) < 0) {
+ if ((ret = ff_reget_buffer(avctx, &mp->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
return ret;
}
@@ -314,8 +313,9 @@ static int mp_decode_frame(AVCodecContext *avctx,
ff_free_vlc(&mp->vlc);
end:
+ if ((ret = av_frame_ref(data, &mp->frame)) < 0)
+ return ret;
*got_frame = 1;
- *(AVFrame *)data = mp->frame;
return buf_size;
}
@@ -327,8 +327,7 @@ static av_cold int mp_decode_end(AVCodecContext *avctx)
av_freep(&mp->vpt);
av_freep(&mp->hpt);
av_freep(&mp->bswapbuf);
- if (mp->frame.data[0])
- avctx->release_buffer(avctx, &mp->frame);
+ av_frame_unref(&mp->frame);
return 0;
}