aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/gifdec.c
diff options
context:
space:
mode:
authorMichel Bardiaux <mbardiaux@mediaxim.be>2007-03-12 12:36:41 +0000
committerMichel Bardiaux <mbardiaux@mediaxim.be>2007-03-12 12:36:41 +0000
commit318c5e052415aada4036c382cb0ef243113f667a (patch)
tree1badf5b9254d9b8807759f59bd6121f9ce180b3b /libavcodec/gifdec.c
parentea486ab3bede4fc68b8cccb70791cdfa589a0fcb (diff)
downloadffmpeg-318c5e052415aada4036c382cb0ef243113f667a.tar.gz
Give context to dprintf
Originally committed as revision 8338 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/gifdec.c')
-rw-r--r--libavcodec/gifdec.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 3debe04acb..64b4931354 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -53,6 +53,8 @@ typedef struct GifState {
/* aux buffers */
uint8_t global_palette[256 * 3];
uint8_t local_palette[256 * 3];
+
+ AVCodecContext* avctx;
} GifState;
static const uint8_t gif87a_sig[6] = "GIF87a";
@@ -73,7 +75,7 @@ static int gif_read_image(GifState *s)
has_local_palette = flags & 0x80;
bits_per_pixel = (flags & 0x07) + 1;
#ifdef DEBUG
- dprintf("gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
+ dprintf(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
#endif
if (has_local_palette) {
@@ -164,7 +166,7 @@ static int gif_read_extension(GifState *s)
ext_code = bytestream_get_byte(&s->bytestream);
ext_len = bytestream_get_byte(&s->bytestream);
#ifdef DEBUG
- dprintf("gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
+ dprintf(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
#endif
switch(ext_code) {
case 0xf9:
@@ -180,7 +182,7 @@ static int gif_read_extension(GifState *s)
s->transparent_color_index = -1;
s->gce_disposal = (gce_flags >> 2) & 0x7;
#ifdef DEBUG
- dprintf("gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
+ dprintf(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
gce_flags, s->gce_delay,
s->transparent_color_index, s->gce_disposal);
#endif
@@ -195,7 +197,7 @@ static int gif_read_extension(GifState *s)
bytestream_get_byte(&s->bytestream);
ext_len = bytestream_get_byte(&s->bytestream);
#ifdef DEBUG
- dprintf("gif: ext_len1=%d\n", ext_len);
+ dprintf(s->avctx, "gif: ext_len1=%d\n", ext_len);
#endif
}
return 0;
@@ -230,7 +232,7 @@ static int gif_read_header1(GifState *s)
s->background_color_index = bytestream_get_byte(&s->bytestream);
bytestream_get_byte(&s->bytestream); /* ignored */
#ifdef DEBUG
- dprintf("gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
+ dprintf(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
s->screen_width, s->screen_height, s->bits_per_pixel,
has_global_palette);
#endif
@@ -248,7 +250,7 @@ static int gif_parse_next_image(GifState *s)
for (;;) {
code = bytestream_get_byte(&s->bytestream);
#ifdef DEBUG
- dprintf("gif: code=%02x '%c'\n", code, code);
+ dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code);
#endif
switch (code) {
case ',':
@@ -279,6 +281,8 @@ static int gif_decode_init(AVCodecContext *avctx)
{
GifState *s = avctx->priv_data;
+ s->avctx = avctx;
+
avcodec_get_frame_defaults(&s->picture);
avctx->coded_frame= &s->picture;
s->picture.data[0] = NULL;