diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-21 21:34:46 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-03-08 07:38:30 +0100 |
commit | 759001c534287a96dc96d1e274665feb7059145d (patch) | |
tree | 6ace9560c20aa30db92067c5b45d7bd86e458d10 /libavcodec/cavs.c | |
parent | 6e7b50b4270116ded8b874d76cb7c5b1a0341827 (diff) | |
download | ffmpeg-759001c534287a96dc96d1e274665feb7059145d.tar.gz |
lavc decoders: work with refcounted frames.
Diffstat (limited to 'libavcodec/cavs.c')
-rw-r--r-- | libavcodec/cavs.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index e6315bc291..abd4bacdda 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -736,9 +736,9 @@ av_cold int ff_cavs_init(AVCodecContext *avctx) { h->avctx = avctx; avctx->pix_fmt= AV_PIX_FMT_YUV420P; - h->cur.f = avcodec_alloc_frame(); - h->DPB[0].f = avcodec_alloc_frame(); - h->DPB[1].f = avcodec_alloc_frame(); + h->cur.f = av_frame_alloc(); + h->DPB[0].f = av_frame_alloc(); + h->DPB[1].f = av_frame_alloc(); if (!h->cur.f || !h->DPB[0].f || !h->DPB[1].f) { ff_cavs_end(avctx); return AVERROR(ENOMEM); @@ -769,15 +769,9 @@ av_cold int ff_cavs_init(AVCodecContext *avctx) { av_cold int ff_cavs_end(AVCodecContext *avctx) { AVSContext *h = avctx->priv_data; - if (h->cur.f->data[0]) - avctx->release_buffer(avctx, h->cur.f); - if (h->DPB[0].f->data[0]) - avctx->release_buffer(avctx, h->DPB[0].f); - if (h->DPB[1].f->data[0]) - avctx->release_buffer(avctx, h->DPB[1].f); - avcodec_free_frame(&h->cur.f); - avcodec_free_frame(&h->DPB[0].f); - avcodec_free_frame(&h->DPB[1].f); + av_frame_free(&h->cur.f); + av_frame_free(&h->DPB[0].f); + av_frame_free(&h->DPB[1].f); av_free(h->top_qp); av_free(h->top_mv[0]); |