diff gui/util/bitmap.c @ 33114:5ad451a5ebec

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.
author ib
date Mon, 04 Apr 2011 12:40:20 +0000
parents cc6d4af87b99
children c2da7b725fd8
line wrap: on
line diff
--- a/gui/util/bitmap.c	Mon Apr 04 12:14:26 2011 +0000
+++ b/gui/util/bitmap.c	Mon Apr 04 12:40:20 2011 +0000
@@ -216,7 +216,7 @@
     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 @@
 
     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 @@
             out->Image = NULL;
         }
     }
+
+    return 1;
 }