comparison vcr1.c @ 11005:bc62e2826782 libavcodec

Release buffer when decoding is finished.
author cehoyos
date Mon, 25 Jan 2010 10:46:32 +0000
parents 54bc8a2727b0
children 8a4984c5cacc
comparison
equal deleted inserted replaced
11004:1c3b1752d6d6 11005:bc62e2826782
156 avctx->pix_fmt= PIX_FMT_YUV410P; 156 avctx->pix_fmt= PIX_FMT_YUV410P;
157 157
158 return 0; 158 return 0;
159 } 159 }
160 160
161 static av_cold int decode_end(AVCodecContext *avctx){
162 VCR1Context *s = avctx->priv_data;
163
164 if (s->picture.data[0])
165 avctx->release_buffer(avctx, &s->picture);
166
167 return 0;
168 }
169
161 #if CONFIG_VCR1_ENCODER 170 #if CONFIG_VCR1_ENCODER
162 static av_cold int encode_init(AVCodecContext *avctx){ 171 static av_cold int encode_init(AVCodecContext *avctx){
163 172
164 common_init(avctx); 173 common_init(avctx);
165 174
172 CODEC_TYPE_VIDEO, 181 CODEC_TYPE_VIDEO,
173 CODEC_ID_VCR1, 182 CODEC_ID_VCR1,
174 sizeof(VCR1Context), 183 sizeof(VCR1Context),
175 decode_init, 184 decode_init,
176 NULL, 185 NULL,
177 NULL, 186 decode_end,
178 decode_frame, 187 decode_frame,
179 CODEC_CAP_DR1, 188 CODEC_CAP_DR1,
180 .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), 189 .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"),
181 }; 190 };
182 191