diff options
Diffstat (limited to 'libavcodec/dsicinav.c')
-rw-r--r-- | libavcodec/dsicinav.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index 85eafcfcca..4f6b731ea0 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -305,8 +305,7 @@ static int cinvideo_decode_frame(AVCodecContext *avctx, break; } - cin->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; - if ((res = avctx->reget_buffer(avctx, &cin->frame))) { + if ((res = ff_reget_buffer(avctx, &cin->frame)) < 0) { av_log(cin->avctx, AV_LOG_ERROR, "failed to allocate a frame\n"); return res; } @@ -320,8 +319,10 @@ static int cinvideo_decode_frame(AVCodecContext *avctx, FFSWAP(uint8_t *, cin->bitmap_table[CIN_CUR_BMP], cin->bitmap_table[CIN_PRE_BMP]); + if ((res = av_frame_ref(data, &cin->frame)) < 0) + return res; + *got_frame = 1; - *(AVFrame *)data = cin->frame; return buf_size; } @@ -330,8 +331,7 @@ static av_cold int cinvideo_decode_end(AVCodecContext *avctx) { CinVideoContext *cin = avctx->priv_data; - if (cin->frame.data[0]) - avctx->release_buffer(avctx, &cin->frame); + av_frame_unref(&cin->frame); destroy_buffers(cin); @@ -363,7 +363,7 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, void *data, /* get output buffer */ frame->nb_samples = avpkt->size - cin->initial_decode_frame; - if ((ret = ff_get_buffer(avctx, frame)) < 0) { + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } |