[xiph-commits] r12733 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Sun Mar 11 15:39:45 PDT 2007


Author: xiphmont
Date: 2007-03-11 15:39:44 -0700 (Sun, 11 Mar 2007)
New Revision: 12733

Modified:
   trunk/sushivision/panel-1d.c
   trunk/sushivision/slider.c
Log:
Minor crash fixes



Modified: trunk/sushivision/panel-1d.c
===================================================================
--- trunk/sushivision/panel-1d.c	2007-03-11 20:10:49 UTC (rev 12732)
+++ trunk/sushivision/panel-1d.c	2007-03-11 22:39:44 UTC (rev 12733)
@@ -1409,7 +1409,6 @@
 
 static int _save_panel1d(sushiv_panel_t *p, xmlNodePtr pn){  
   sushiv_panel1d_t *p1 = p->subtype->p1;
-  char buffer[80];
   int ret=0,i;
 
   xmlNodePtr n;
@@ -1419,8 +1418,8 @@
   // box
   if(p->private->oldbox_active){
     xmlNodePtr boxn = xmlNewChild(pn, NULL, (xmlChar *) "box", NULL);
-    xmlNewPropF(boxn, (xmlChar *)"x1", p1->oldbox[0]);
-    xmlNewPropF(boxn, (xmlChar *)"x2", p1->oldbox[1]);
+    xmlNewPropF(boxn, "x1", p1->oldbox[0]);
+    xmlNewPropF(boxn, "x2", p1->oldbox[1]);
   }
   
   // objective map settings
@@ -1429,7 +1428,7 @@
 
     xmlNodePtr on = xmlNewChild(pn, NULL, (xmlChar *) "objective", NULL);
     xmlNewPropI(on, "position", i);
-    xmlNewProp(on, "number", o->number);
+    xmlNewPropI(on, "number", o->number);
     xmlNewPropS(on, "name", o->name);
     xmlNewPropS(on, "type", o->output_types);
     

Modified: trunk/sushivision/slider.c
===================================================================
--- trunk/sushivision/slider.c	2007-03-11 20:10:49 UTC (rev 12732)
+++ trunk/sushivision/slider.c	2007-03-11 22:39:44 UTC (rev 12733)
@@ -113,7 +113,8 @@
 }
 
 void slider_draw_background(Slider *s){
-  slider_realize(s);
+  if(!s->realized)return;
+
   int i;
   GtkWidget *parent=gtk_widget_get_parent(s->slices[0]);
   GdkColor *text = &s->slices[0]->style->text[0];
@@ -242,10 +243,10 @@
       free(s->backdata);
 
     s->backdata = calloc(w*h,4);
-
-      s->background = cairo_image_surface_create_for_data ((unsigned char *)s->backdata,
-							   CAIRO_FORMAT_RGB24,
-							   w,h,w*4);
+    
+    s->background = cairo_image_surface_create_for_data ((unsigned char *)s->backdata,
+							 CAIRO_FORMAT_RGB24,
+							 w,h,w*4);
     if(s->flip){
       s->foreground = cairo_image_surface_create (CAIRO_FORMAT_RGB24,
 						  h,w);
@@ -259,6 +260,7 @@
 
     s->xpad=h*.45;
     if(s->xpad<4)s->xpad=4;
+    s->realized = 1;
     slider_draw_background(s);    
     slider_draw(s);
 
@@ -311,7 +313,7 @@
 }
 
 void slider_draw(Slider *s){
-  slider_realize(s);
+  if(!s->realized)return;
 
   int i;
   cairo_t *c;



More information about the commits mailing list