comparison cscd.c @ 4827:b3ee9a1526b0 libavcodec

Get rid of unnecessary pointer casts. patch by Nicholas Tung, ntung ntung com
author diego
date Sun, 08 Apr 2007 20:24:16 +0000
parents 66ef3690d108
children f99e40a7155b
comparison
equal deleted inserted replaced
4826:9ca9a53a848b 4827:b3ee9a1526b0
135 } 135 }
136 #endif 136 #endif
137 137
138 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, 138 static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
139 uint8_t *buf, int buf_size) { 139 uint8_t *buf, int buf_size) {
140 CamStudioContext *c = (CamStudioContext *)avctx->priv_data; 140 CamStudioContext *c = avctx->priv_data;
141 AVFrame *picture = data; 141 AVFrame *picture = data;
142 142
143 if (buf_size < 2) { 143 if (buf_size < 2) {
144 av_log(avctx, AV_LOG_ERROR, "coded frame too small\n"); 144 av_log(avctx, AV_LOG_ERROR, "coded frame too small\n");
145 return -1; 145 return -1;
212 *data_size = sizeof(AVFrame); 212 *data_size = sizeof(AVFrame);
213 return buf_size; 213 return buf_size;
214 } 214 }
215 215
216 static int decode_init(AVCodecContext *avctx) { 216 static int decode_init(AVCodecContext *avctx) {
217 CamStudioContext *c = (CamStudioContext *)avctx->priv_data; 217 CamStudioContext *c = avctx->priv_data;
218 if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) { 218 if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
219 return 1; 219 return 1;
220 } 220 }
221 switch (avctx->bits_per_sample) { 221 switch (avctx->bits_per_sample) {
222 case 16: avctx->pix_fmt = PIX_FMT_RGB555; break; 222 case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
240 } 240 }
241 return 0; 241 return 0;
242 } 242 }
243 243
244 static int decode_end(AVCodecContext *avctx) { 244 static int decode_end(AVCodecContext *avctx) {
245 CamStudioContext *c = (CamStudioContext *)avctx->priv_data; 245 CamStudioContext *c = avctx->priv_data;
246 av_freep(&c->decomp_buf); 246 av_freep(&c->decomp_buf);
247 if (c->pic.data[0]) 247 if (c->pic.data[0])
248 avctx->release_buffer(avctx, &c->pic); 248 avctx->release_buffer(avctx, &c->pic);
249 return 0; 249 return 0;
250 } 250 }