aatv: Fixes for rain-mode
authorFlorian Zwoch <fzwoch@gmail.com>
Mon, 20 Dec 2021 09:28:50 +0000 (09:28 +0000)
committerFlorian Zwoch <fzwoch@gmail.com>
Mon, 20 Dec 2021 09:28:50 +0000 (09:28 +0000)
Some rain-mode properties tried to read float from int value.
Initialize rain after setting rain-mode. Rain was non-functional if
width/height were left at default values.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1459>

subprojects/gst-plugins-good/ext/aalib/gstaatv.c

index 1b363df..280d81d 100644 (file)
@@ -831,27 +831,28 @@ gst_aatv_set_property (GObject * object, guint prop_id, const GValue * value,
       break;
     }
     case PROP_RAIN_DELAY_MIN:{
-      if (g_value_get_float (value) <= aatv->rain_delay_max)
+      if (g_value_get_int (value) <= aatv->rain_delay_max)
         aatv->rain_delay_min = g_value_get_int (value);
       break;
     }
     case PROP_RAIN_DELAY_MAX:{
-      if (g_value_get_float (value) >= aatv->rain_delay_min)
+      if (g_value_get_int (value) >= aatv->rain_delay_min)
         aatv->rain_delay_max = g_value_get_int (value);
       break;
     }
     case PROP_RAIN_LENGTH_MIN:{
-      if (g_value_get_float (value) <= aatv->rain_length_max)
+      if (g_value_get_int (value) <= aatv->rain_length_max)
         aatv->rain_length_min = g_value_get_int (value);
       break;
     }
     case PROP_RAIN_LENGTH_MAX:{
-      if (g_value_get_float (value) >= aatv->rain_length_min)
+      if (g_value_get_int (value) >= aatv->rain_length_min)
         aatv->rain_length_max = g_value_get_int (value);
       break;
     }
     case PROP_RAIN_MODE:{
       aatv->rain_mode = g_value_get_enum (value);
+      gst_aatv_rain_init (aatv);
       break;
     }
     default: