videobalance: fix handling of YUV images with 'odd' widths
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 11 Apr 2011 18:50:07 +0000 (19:50 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 13 Apr 2011 16:22:19 +0000 (17:22 +0100)
Fixes unused-but-set-variable warnings with gcc 4.6.

gst/videofilter/gstvideobalance.c

index 968e259..184b893 100644 (file)
@@ -233,8 +233,8 @@ gst_video_balance_planar_yuv (GstVideoBalance * videobalance, guint8 * data)
 
     yptr = ydata + y * ystride;
     for (x = 0; x < width; x++) {
-      *ydata = tabley[*ydata];
-      ydata++;
+      *yptr = tabley[*yptr];
+      yptr++;
     }
   }
 
@@ -294,8 +294,8 @@ gst_video_balance_packed_yuv (GstVideoBalance * videobalance, guint8 * data)
 
     yptr = ydata + y * ystride;
     for (x = 0; x < width; x++) {
-      *ydata = tabley[*ydata];
-      ydata += yoff;
+      *yptr = tabley[*yptr];
+      yptr += yoff;
     }
   }
 
@@ -668,7 +668,7 @@ gst_video_balance_colorbalance_set_value (GstColorBalance * balance,
 {
   GstVideoBalance *vb = GST_VIDEO_BALANCE (balance);
   gdouble new_val;
-  gboolean changed;
+  gboolean changed = FALSE;
 
   g_return_if_fail (vb != NULL);
   g_return_if_fail (GST_IS_VIDEO_BALANCE (vb));
@@ -695,12 +695,15 @@ gst_video_balance_colorbalance_set_value (GstColorBalance * balance,
     vb->contrast = new_val;
   }
 
-  gst_video_balance_update_properties (vb);
+  if (changed)
+    gst_video_balance_update_properties (vb);
   GST_OBJECT_UNLOCK (vb);
   GST_BASE_TRANSFORM_UNLOCK (vb);
 
-  gst_color_balance_value_changed (balance, channel,
-      gst_color_balance_get_value (balance, channel));
+  if (changed) {
+    gst_color_balance_value_changed (balance, channel,
+        gst_color_balance_get_value (balance, channel));
+  }
 }
 
 static gint