comparison xl.c @ 10399:136334ad62b3 libavcodec

Release frame after decoding is done
author kostya
date Wed, 14 Oct 2009 05:28:24 +0000
parents 54bc8a2727b0
children 8a137661f31e
comparison
equal deleted inserted replaced
10398:11b685acd280 10399:136334ad62b3
126 avctx->pix_fmt= PIX_FMT_YUV411P; 126 avctx->pix_fmt= PIX_FMT_YUV411P;
127 127
128 return 0; 128 return 0;
129 } 129 }
130 130
131 static av_cold int decode_end(AVCodecContext *avctx){
132 VideoXLContext * const a = avctx->priv_data;
133 AVFrame *pic = &a->pic;
134
135 if (pic->data[0])
136 avctx->release_buffer(avctx, pic);
137 av_freep(&a->pic);
138
139 return 0;
140 }
141
131 AVCodec xl_decoder = { 142 AVCodec xl_decoder = {
132 "xl", 143 "xl",
133 CODEC_TYPE_VIDEO, 144 CODEC_TYPE_VIDEO,
134 CODEC_ID_VIXL, 145 CODEC_ID_VIXL,
135 sizeof(VideoXLContext), 146 sizeof(VideoXLContext),
136 decode_init, 147 decode_init,
137 NULL, 148 NULL,
138 NULL, 149 decode_end,
139 decode_frame, 150 decode_frame,
140 CODEC_CAP_DR1, 151 CODEC_CAP_DR1,
141 .long_name = NULL_IF_CONFIG_SMALL("Miro VideoXL"), 152 .long_name = NULL_IF_CONFIG_SMALL("Miro VideoXL"),
142 }; 153 };