# HG changeset patch # User ib # Date 1301918487 0 # Node ID 654dfdf176acb28f1e8ac94b05b6a7518da28608 # Parent 7b7d030892559b60d007deddaec18d97fb0f74b6 Revise debug messages. All messages start with [bitmap] and are level MSGL_DBG2 now. The texts have been revised, some messages were added or removed. diff -r 7b7d03089255 -r 654dfdf176ac gui/util/bitmap.c --- a/gui/util/bitmap.c Mon Apr 04 10:49:54 2011 +0000 +++ b/gui/util/bitmap.c Mon Apr 04 12:01:27 2011 +0000 @@ -41,7 +41,7 @@ fp = fopen(fname, "rb"); if (!fp) { - mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[png] file read error ( %s )\n", fname); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] open error: %s\n", fname); return 1; } @@ -50,6 +50,7 @@ if (len > 50 * 1024 * 1024) { fclose(fp); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] file too big: %s\n", fname); return 2; } @@ -110,9 +111,9 @@ av_freep(&avctx); av_freep(&data); - mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[png] filename: %s.\n", fname); - mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[png] size: %lux%lu bits: %u\n", bf->Width, bf->Height, bf->BPP); - mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[png] imagesize: %lu\n", bf->ImageSize); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] file: %s\n", fname); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] size: %lux%lu, color depth: %u\n", bf->Width, bf->Height, bf->BPP); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] image size: %lu\n", bf->ImageSize); return !(decode_ok && bf->BPP); } @@ -130,10 +131,12 @@ if (!bf->Image) { free(tmpImage); - mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory for image\n"); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %lu\n", bf->ImageSize); return 1; } + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 32 bpp conversion size: %lu\n", bf->ImageSize); + for (c = 0, i = 0; c < bf->ImageSize; c += 4, i += 3) *(uint32_t *)&bf->Image[c] = AV_RB24(&tmpImage[i]); @@ -190,12 +193,12 @@ return -2; if (pngRead(fname, bf)) { - mp_dbg(MSGT_GPLAYER, MSGL_FATAL, "[bitmap] unknown file type ( %s )\n", fname); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] read error: %s\n", fname); return -5; } if (bf->BPP < 24) { - mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] Sorry, only 24 and 32 bpp bitmaps are supported.\n"); + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] bpp too low: %u\n", bf->BPP); return -1; } @@ -220,8 +223,6 @@ out->BPP = 1; out->ImageSize = (out->Width * out->Height + 7) / 8; - mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[c32to1] imagesize: %lu\n", out->ImageSize); - out->Image = calloc(1, out->ImageSize); if (out->Image == NULL) @@ -248,6 +249,8 @@ } } + mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] 1 bpp conversion size: %lu\n", out->ImageSize); + if (b) out->Image[c] = tmp;