Mercurial > libavcodec.hg
comparison gifdec.c @ 4717:dd9ad0da0a51 libavcodec
simplify
author | bcoudurier |
---|---|
date | Sat, 24 Mar 2007 23:53:34 +0000 |
parents | 6679d37a3338 |
children | 9962405d2d18 |
comparison
equal
deleted
inserted
replaced
4716:8c00d22d45a0 | 4717:dd9ad0da0a51 |
---|---|
243 return 0; | 243 return 0; |
244 } | 244 } |
245 | 245 |
246 static int gif_parse_next_image(GifState *s) | 246 static int gif_parse_next_image(GifState *s) |
247 { | 247 { |
248 int ret, code; | |
249 | |
250 for (;;) { | 248 for (;;) { |
251 code = bytestream_get_byte(&s->bytestream); | 249 int code = bytestream_get_byte(&s->bytestream); |
252 #ifdef DEBUG | 250 #ifdef DEBUG |
253 dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code); | 251 dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code); |
254 #endif | 252 #endif |
255 switch (code) { | 253 switch (code) { |
256 case ',': | 254 case ',': |
257 if (gif_read_image(s) < 0) | 255 if (gif_read_image(s) < 0) |
258 return -1; | 256 return -1; |
259 ret = 0; | 257 return 0; |
260 goto the_end; | |
261 case ';': | 258 case ';': |
262 /* end of image */ | 259 /* end of image */ |
263 ret = -1; | 260 return -1; |
264 goto the_end; | |
265 case '!': | 261 case '!': |
266 if (gif_read_extension(s) < 0) | 262 if (gif_read_extension(s) < 0) |
267 return -1; | 263 return -1; |
268 break; | 264 break; |
269 case EOF: | |
270 default: | 265 default: |
271 /* error or errneous EOF */ | 266 /* error or errneous EOF */ |
272 ret = -1; | 267 return -1; |
273 goto the_end; | |
274 } | 268 } |
275 } | 269 } |
276 the_end: | |
277 return ret; | |
278 } | 270 } |
279 | 271 |
280 static int gif_decode_init(AVCodecContext *avctx) | 272 static int gif_decode_init(AVCodecContext *avctx) |
281 { | 273 { |
282 GifState *s = avctx->priv_data; | 274 GifState *s = avctx->priv_data; |