[maemo-commits] [maemo-commits] r13109 - in projects/haf/tags/hildon-thumbnail/0.13: . debian thumbs

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Aug 10 15:32:22 EEST 2007
Author: kihamala
Date: 2007-08-10 15:32:20 +0300 (Fri, 10 Aug 2007)
New Revision: 13109

Modified:
   projects/haf/tags/hildon-thumbnail/0.13/ChangeLog
   projects/haf/tags/hildon-thumbnail/0.13/debian/changelog
   projects/haf/tags/hildon-thumbnail/0.13/thumbs/thumber-gdk-pixbuf.c
Log:
fixes


Modified: projects/haf/tags/hildon-thumbnail/0.13/ChangeLog
===================================================================
--- projects/haf/tags/hildon-thumbnail/0.13/ChangeLog	2007-08-10 12:25:51 UTC (rev 13108)
+++ projects/haf/tags/hildon-thumbnail/0.13/ChangeLog	2007-08-10 12:32:20 UTC (rev 13109)
@@ -1,9 +1,8 @@
 2007-08-10  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
-	Patch from Daniil Ivanov:
-	* thumbs/thumber-gdk-pixbuf.c: Add global variable 'oom'.
-	(create_thumb): Check OOM condition from the 'oom' variable.
-	Read four bytes at a time, in case it is more ARM-friendly.
+	Applied a modified patch from Daniil Ivanov:
+	* thumbs/thumber-gdk-pixbuf.c (create_thumb): Read four bytes at a
+	time instead of one.
 	(thumbnailer_oom_func): New.
 	(main): Register thumbnailer_oom_func as the OOM callback. Add Glib
 	thread initialisation. Fixes: NB#63712

Modified: projects/haf/tags/hildon-thumbnail/0.13/debian/changelog
===================================================================
--- projects/haf/tags/hildon-thumbnail/0.13/debian/changelog	2007-08-10 12:25:51 UTC (rev 13108)
+++ projects/haf/tags/hildon-thumbnail/0.13/debian/changelog	2007-08-10 12:32:20 UTC (rev 13109)
@@ -1,6 +1,8 @@
 hildon-thumbnail (0.13) unstable; urgency=low
 
   * Added Glib thread initialisation.
+  * Now OOM handler simply exits because the thumbnailer was still jamming
+    sometimes with Daniil's patch.
 
  -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Fri, 10 Aug 2007 15:13:11 +0300
 

Modified: projects/haf/tags/hildon-thumbnail/0.13/thumbs/thumber-gdk-pixbuf.c
===================================================================
--- projects/haf/tags/hildon-thumbnail/0.13/thumbs/thumber-gdk-pixbuf.c	2007-08-10 12:25:51 UTC (rev 13108)
+++ projects/haf/tags/hildon-thumbnail/0.13/thumbs/thumber-gdk-pixbuf.c	2007-08-10 12:32:20 UTC (rev 13109)
@@ -32,8 +32,6 @@
 #include <stdio.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
-static gboolean oom = FALSE;
-
 GdkPixbuf *crop_resize(GdkPixbuf *src, int width, int height) {
     int x = width, y = height;
     int a = gdk_pixbuf_get_width(src);
@@ -156,7 +154,7 @@
        g_signal_connect(loader, "size-prepared", G_CALLBACK(size_prepared),
                         GINT_TO_POINTER(desired_max_area));
 
-       while (!oom && items_read >= sizeof(buffer) / BLK)
+       while (items_read >= sizeof(buffer) / BLK)
        {
          long pos;
          int nbytes;
@@ -195,7 +193,7 @@
        /* Loader owns reference to this pixbuf */
        pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
 
-       if(pixbuf && !oom)
+       if (pixbuf)
          result = crop_resize(pixbuf, width, height);
 cleanup:
        fclose(f);
@@ -221,8 +219,8 @@
 static void
 thumbnailer_oom_func (size_t cur, size_t max, void *data)
 {
-    ULOG_DEBUG_F("Memory low: %u of %u!", cur, max);
-    oom = TRUE;
+    ULOG_DEBUG_F("OOM: %u of %u!", cur, max);
+    exit(1);
 }
 
 int main(int argc, char **argv)


More information about the maemo-commits mailing list