[MPlayer-cvslog] r33201 - in trunk: gui/skin/skin.c gui/util/bitmap.c gui/util/bitmap.h help/help_mp-bg.h help/help_mp-cs.h help/help_mp-de.h help/help_mp-en.h help/help_mp-es.h help/help_mp-fr.h help/help_mp-hu.h ...

ib subversion at mplayerhq.hu
Mon Apr 4 14:40:20 CEST 2011


Author: ib
Date: Mon Apr  4 14:40:20 2011
New Revision: 33201

Log:
Remove useless warning message.

Instead, add debug message and return whether conversion was successful
or not and use the return code to issue an appropriate error message.

Modified:
   trunk/gui/skin/skin.c
   trunk/gui/util/bitmap.c
   trunk/gui/util/bitmap.h

Changes in other areas also in this revision:
Modified:
   trunk/help/help_mp-bg.h
   trunk/help/help_mp-cs.h
   trunk/help/help_mp-de.h
   trunk/help/help_mp-en.h
   trunk/help/help_mp-es.h
   trunk/help/help_mp-fr.h
   trunk/help/help_mp-hu.h
   trunk/help/help_mp-it.h
   trunk/help/help_mp-pl.h
   trunk/help/help_mp-ru.h
   trunk/help/help_mp-tr.h
   trunk/help/help_mp-uk.h
   trunk/help/help_mp-zh_CN.h
   trunk/help/help_mp-zh_TW.h

Modified: trunk/gui/skin/skin.c
==============================================================================
--- trunk/gui/skin/skin.c	Mon Apr  4 14:14:26 2011	(r33200)
+++ trunk/gui/skin/skin.c	Mon Apr  4 14:40:20 2011	(r33201)
@@ -277,7 +277,10 @@ static int item_base(char *in)
 
     if (!is_sub) {
 #ifdef CONFIG_XSHAPE
-        Convert32to1(&currWin->Bitmap, &currWin->Mask, 0x00ff00ff);
+        if (!Convert32to1(&currWin->Bitmap, &currWin->Mask, 0x00ff00ff)) {
+            skin_error(MSGTR_SKIN_NotEnoughMemory);
+            return 1;
+        }
         mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[skin]     mask: %lux%lu\n", currWin->Mask.Width, currWin->Mask.Height);
 #else
         currWin->Mask.Image = NULL;

Modified: trunk/gui/util/bitmap.c
==============================================================================
--- trunk/gui/util/bitmap.c	Mon Apr  4 14:14:26 2011	(r33200)
+++ trunk/gui/util/bitmap.c	Mon Apr  4 14:40:20 2011	(r33201)
@@ -216,7 +216,7 @@ void bpFree(txSample *bf)
     memset(bf, 0, sizeof(*bf));
 }
 
-void Convert32to1(txSample *in, txSample *out, int adaptivlimit)
+int Convert32to1(txSample *in, txSample *out, int adaptivlimit)
 {
     out->Width     = in->Width;
     out->Height    = in->Height;
@@ -225,9 +225,10 @@ void Convert32to1(txSample *in, txSample
 
     out->Image = calloc(1, out->ImageSize);
 
-    if (out->Image == NULL)
-        mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_NotEnoughMemoryC32To1);
-    else {
+    if (out->Image == NULL) {
+        mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[bitmap] not enough memory: %lu\n", out->ImageSize);
+        return 0;
+    } else {
         int i, b, c = 0;
         unsigned int *buf = NULL;
         unsigned char tmp = 0;
@@ -259,4 +260,6 @@ void Convert32to1(txSample *in, txSample
             out->Image = NULL;
         }
     }
+
+    return 1;
 }

Modified: trunk/gui/util/bitmap.h
==============================================================================
--- trunk/gui/util/bitmap.h	Mon Apr  4 14:14:26 2011	(r33200)
+++ trunk/gui/util/bitmap.h	Mon Apr  4 14:40:20 2011	(r33201)
@@ -29,6 +29,6 @@ typedef struct {
 
 void bpFree(txSample *bf);
 int bpRead(char *fname, txSample *bf);
-void Convert32to1(txSample *in, txSample *out, int adaptivlimit);
+int Convert32to1(txSample *in, txSample *out, int adaptivlimit);
 
 #endif /* MPLAYER_GUI_BITMAP_H */


More information about the MPlayer-cvslog mailing list