summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-06-30 11:48:09 (GMT)
committerStefan Kost <ensonic@users.sf.net>2009-06-30 11:53:25 (GMT)
commit6d0007372b317b049f475fab0df0ea03195332dc (patch)
treec533449b1258ea50af5f4d76f168c3bd45f318dd
parentce7a24cbd99302a685d0f2f9c0fd767eb7b619d6 (diff)
pulsesink: include "1.0=100%" in volume and change upper limit
Upper volume limmit was 1000. That appear unneceasrily high. It would also cause sever distortion if accidentialy used. Now its 10 (~ +15db) which is also in sync with volume and playbin2.
-rw-r--r--ext/pulse/pulsesink.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c
index a261c1e..c3f3754 100644
--- a/ext/pulse/pulsesink.c
+++ b/ext/pulse/pulsesink.c
@@ -62,6 +62,7 @@ GST_DEBUG_CATEGORY_EXTERN (pulse_debug);
#define DEFAULT_DEVICE NULL
#define DEFAULT_DEVICE_NAME NULL
#define DEFAULT_VOLUME 1.0
+#define MAX_VOLUME 10.0
enum
{
@@ -1398,7 +1399,7 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass)
g_object_class_install_property (gobject_class,
PROP_VOLUME,
g_param_spec_double ("volume", "Volume",
- "Volume of this stream", 0.0, 1000.0, DEFAULT_VOLUME,
+ "Volume of this stream, 1.0=100%", 0.0, MAX_VOLUME, DEFAULT_VOLUME,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#endif
}
@@ -1599,6 +1600,11 @@ unlock:
v = psink->volume;
pa_threaded_mainloop_unlock (psink->mainloop);
+ if (v > MAX_VOLUME) {
+ GST_WARNING_OBJECT (psink, "Clipped volume from %f to %f", v, MAX_VOLUME);
+ v = MAX_VOLUME;
+ }
+
return v;
/* ERRORS */