rem: if (found_channel && GST_IS_COLOR_BALANCE_CHANNEL (found_channel)) { value = gst_color_balance_get_value (bvw->priv->balance, found_channel); value = ((double) value - found_channel->min_value) * 65535 / ((double) found_channel->max_value - found_channel->min_value); g_object_unref (found_channel);  return value; }
add: if (found_channel && GST_IS_COLOR_BALANCE_CHANNEL (found_channel)) { ret = gst_color_balance_get_value (bvw->priv->balance, found_channel); ret = ((double) ret - found_channel->min_value) * 65535 / ((double) found_channel->max_value - found_channel->min_value); g_object_unref (found_channel); goto done; }
context: bacon_video_widget_get_video_property (BaconVideoWidget *bvw,                                       BaconVideoWidgetVideoProperty type){  int value = 65535 / 2;  g_return_val_if_fail (bvw != NULL, value);  g_return_val_if_fail (BACON_IS_VIDEO_WIDGET (bvw), value);    if (bvw->priv->balance && GST_IS_COLOR_BALANCE (bvw->priv->balance))    {      const GList *channels_list = NULL;      GstColorBalanceChannel *found_channel = NULL;            channels_list = gst_color_balance_list_channels (bvw->priv->balance);            while (channels_list != NULL && found_channel == NULL)        { /* We search for the right channel corresponding to type */          GstColorBalanceChannel *channel = channels_list->data;          if (type == BVW_VIDEO_BRIGHTNESS && channel &&              g_strrstr (channel->label, "BRIGHTNESS"))            {              g_object_ref (channel);              found_channel = channel;            }          else if (type == BVW_VIDEO_CONTRAST && channel &&              g_strrstr (channel->label, "CONTRAST"))            {              g_object_ref (channel);              found_channel = channel;            }          else if (type == BVW_VIDEO_SATURATION && channel &&              g_strrstr (channel->label, "SATURATION"))            {              g_object_ref (channel);              found_channel = channel;            }          else if (type == BVW_VIDEO_HUE && channel &&              g_strrstr (channel->label, "HUE"))            {              g_object_ref (channel);              found_channel = channel;            }          channels_list = g_list_next (channels_list);        }              if (found_channel && GST_IS_COLOR_BALANCE_CHANNEL (found_channel))        {          value = gst_color_balance_get_value (bvw->priv->balance,                                               found_channel);          value = ((double) value - found_channel->min_value) * 65535 /                  ((double) found_channel->max_value - found_channel->min_value);          g_object_unref (found_channel);	  return value;        }    }  /* value wasn't found, get from gconf */  return gconf_client_get_int (bvw->priv->gc, video_props_str[type], NULL);}