diff options
Diffstat (limited to 'libavcodec/msrle.c')
-rw-r--r-- | libavcodec/msrle.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 7187d1a5e1..3b82b82ff4 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -33,6 +33,7 @@ #include <string.h> #include "avcodec.h" +#include "internal.h" #include "msrledec.h" typedef struct MsrleContext { @@ -92,9 +93,7 @@ static int msrle_decode_frame(AVCodecContext *avctx, s->buf = buf; s->size = buf_size; - s->frame.reference = 3; - s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; - if ((ret = avctx->reget_buffer(avctx, &s->frame)) < 0) { + if ((ret = ff_reget_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); return ret; } @@ -136,8 +135,10 @@ static int msrle_decode_frame(AVCodecContext *avctx, ff_msrle_decode(avctx, (AVPicture*)&s->frame, avctx->bits_per_coded_sample, &s->gb); } + if ((ret = av_frame_ref(data, &s->frame)) < 0) + return ret; + *got_frame = 1; - *(AVFrame*)data = s->frame; /* report that the buffer was completely consumed */ return buf_size; @@ -148,8 +149,7 @@ static av_cold int msrle_decode_end(AVCodecContext *avctx) MsrleContext *s = avctx->priv_data; /* release the last frame */ - if (s->frame.data[0]) - avctx->release_buffer(avctx, &s->frame); + av_frame_unref(&s->frame); return 0; } |