Mercurial > libavcodec.hg
comparison qdrw.c @ 10399:136334ad62b3 libavcodec
Release frame after decoding is done
author | kostya |
---|---|
date | Wed, 14 Oct 2009 05:28:24 +0000 |
parents | d7ed9dcc78e3 |
children | 8a137661f31e |
comparison
equal
deleted
inserted
replaced
10398:11b685acd280 | 10399:136334ad62b3 |
---|---|
138 avctx->pix_fmt= PIX_FMT_PAL8; | 138 avctx->pix_fmt= PIX_FMT_PAL8; |
139 | 139 |
140 return 0; | 140 return 0; |
141 } | 141 } |
142 | 142 |
143 static av_cold int decode_end(AVCodecContext *avctx){ | |
144 QdrawContext * const a = avctx->priv_data; | |
145 AVFrame *pic = &a->pic; | |
146 | |
147 if (pic->data[0]) | |
148 avctx->release_buffer(avctx, pic); | |
149 av_freep(&a->pic); | |
150 | |
151 return 0; | |
152 } | |
153 | |
143 AVCodec qdraw_decoder = { | 154 AVCodec qdraw_decoder = { |
144 "qdraw", | 155 "qdraw", |
145 CODEC_TYPE_VIDEO, | 156 CODEC_TYPE_VIDEO, |
146 CODEC_ID_QDRAW, | 157 CODEC_ID_QDRAW, |
147 sizeof(QdrawContext), | 158 sizeof(QdrawContext), |
148 decode_init, | 159 decode_init, |
149 NULL, | 160 NULL, |
150 NULL, | 161 decode_end, |
151 decode_frame, | 162 decode_frame, |
152 CODEC_CAP_DR1, | 163 CODEC_CAP_DR1, |
153 .long_name = NULL_IF_CONFIG_SMALL("Apple QuickDraw"), | 164 .long_name = NULL_IF_CONFIG_SMALL("Apple QuickDraw"), |
154 }; | 165 }; |