aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/gstreamer/gstreamer1.0-plugins-base/fix-gstvolume.patch
blob: f67a8401a9a361c23fb1e40827cd6186c8b62c9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/gst/volume/gstvolume.c b/gst/volume/gstvolume.c
index 0f5b362..94d03a3 100644
--- a/gst/volume/gstvolume.c
+++ b/gst/volume/gstvolume.c
@@ -250,10 +250,14 @@ volume_update_volume (GstVolume * self, const GstAudioInfo * info,
     self->current_mute = FALSE;
     self->current_volume = volume;
 
-    self->current_vol_i8 = volume * VOLUME_UNITY_INT8;
-    self->current_vol_i16 = volume * VOLUME_UNITY_INT16;
-    self->current_vol_i24 = volume * VOLUME_UNITY_INT24;
-    self->current_vol_i32 = volume * VOLUME_UNITY_INT32;
+    self->current_vol_i8 =
+        (gint) ((gdouble) volume * (gdouble) VOLUME_UNITY_INT8);
+    self->current_vol_i16 =
+        (gint) ((gdouble) volume * (gdouble) VOLUME_UNITY_INT16);
+    self->current_vol_i24 =
+        (gint) ((gdouble) volume * (gdouble) VOLUME_UNITY_INT24);
+    self->current_vol_i32 =
+        (gint) ((gdouble) volume * (gdouble) VOLUME_UNITY_INT32);
 
     passthrough = (self->current_vol_i16 == VOLUME_UNITY_INT16);
   }